Git Product home page Git Product logo

damn-tiny-3x7-segment-display-module's Introduction

Damn-Tiny-3x7-Segment-Display-Module

Damn Tiny 3x7 Segment Display PCB Module

Board

Top:

Topside

Bottom:

Bottomside

Sample code using ATTINY84

See: ./code/attiny84.ino

// ATMEL ATTINY84
//                          +-\/-+
//                    VCC  1|    |14  GND
//             (D10)  PB0  2|x   |13  AREF (D 0)
//             (D 9)  PB1  3|x   |12  PA1  (D 1)
//                    PB3  4|    |11  PA2  (D 2)
//  PWM  INT0  (D 8)  PB2  5|x   |10  PA3  (D 3)
//  PWM        (D 7)  PA7  6|    |9   PA4  (D 4)
//  PWM        (D 6)  PA6  7|    |8   PA5  (D 5)        PWM
//
//
//  These pin numbers will probably not work with your hardware
//  pin  8 = DATA IN
//  pin  9 = CLK
//  pin 10 = LOAD

#include "LedControl.h";

LedControl lc = LedControl(8, 9, 10, 1);

void setup() {
    lc.shutdown(0,false);
    lc.setIntensity(0,10);
    lc.clearDisplay(0);

    // Noise from unused pin
    randomSeed(analogRead(A6));
}

void printDigit(int v) {
    int ones, tens, hundreds;

    if (v < -999 || v > 999)
    return;

    ones = v % 10;
    v = v / 10;
    tens = v % 10;
    v = v / 10;
    hundreds = v;

    (hundreds == 0)
        ? lc.setChar(0, 0, ' ', false)
        : lc.setDigit(0, 0, (byte)hundreds, false);
    (tens == 0 && hundreds == 0)
        ? lc.setChar(0, 1, ' ', false)
        : lc.setDigit(0, 1, (byte)tens, false);

    lc.setDigit(0, 2, (byte)ones, false);
}

void loop() {
    printDigit(random(0, 999));
    delay(1000);
}

Changelog

v0.9

  • Initial version

damn-tiny-3x7-segment-display-module's People

Contributors

vlrmprjct avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.