Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 2 digit 7 seg count. But both digits show same number.
- 11,22,33,44... and so on.
- */
- const byte ledCharSet[10] = //which segments to light up, numbers: 0-9
- {
- B01110111, B00010100, B10110011, B10110110, B11010100,
- B11100110, B11100111, B00110100, B11110111, B11110110
- };
- const int latchPin = 8;
- const int clockPin = 12;
- const int dataPin = 11;
- void setup()
- {
- pinMode(latchPin, OUTPUT);
- pinMode(clockPin, OUTPUT);
- pinMode(dataPin, OUTPUT);
- }
- void loop() {
- for (int i = 0; i < 10; i++) {
- shiftOut(dataPin, clockPin, MSBFIRST, ledCharSet[i]);
- shiftOut(dataPin, clockPin, MSBFIRST, ledCharSet[i]); //Here I need some help to make the number
- digitalWrite(latchPin, HIGH); //change everytime the last digit is 0
- delay(1000); //example: 29 to 30, when last digit turns to 0, first
- digitalWrite(latchPin, LOW); //digit + 1
- }}
Advertisement
Add Comment
Please, Sign In to add comment