const int dataPin = 2;
const int clockPin = 3;
const int latchPin = 4;
byte num[] = { 0b00111111, 0b00000110, 0b01011011, 0b01001111, 0b01100110,
0b01101101, 0b01111101, 0b00000111, 0b01111111, 0b01101111 };
int number = 0, tens = number / 10 , units = number % 10 ;
// int numbers[] = {tens, units} ;
void setup() {
// put your setup code here, to run once:
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(latchPin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, num[units]);
shiftOut(dataPin, clockPin, MSBFIRST, num[tens]);
digitalWrite(latchPin, HIGH);
number = ++number % 100;
tens = number / 10;
units = number % 10;
// numbers[0] = number / 10;
// numbers[1] = number % 10;
delay(100);
}