Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define DATA 11 // Pin TPIC6B595 3
- #define LATCH 10 // Pin TPIC6B595 12
- #define CLOCK 12 // Pin TPIC6B595 13
- int digits[] = {
- B11111100,
- B01100000,
- B11011010,
- B11110010,
- B01100110,
- B10110110,
- B10111110,
- B11100000,
- B11111110,
- B11110110,
- B11101110,
- B00111110,
- B10011100,
- B01111010,
- B10011110,
- B10001110};
- void setup() {
- pinMode(DATA, OUTPUT);
- pinMode(LATCH, OUTPUT);
- pinMode(CLOCK, OUTPUT);
- Serial.begin(9600);
- }
- void loop() {
- int i;
- for (i = 0; i < 16; i++) {
- Serial.println(i);
- digitalWrite(LATCH, LOW);
- shiftOut(DATA, CLOCK, LSBFIRST, digits[i]);
- digitalWrite(LATCH, HIGH);
- delay(500);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement