Please Help!!
I started out this code to initially display 24 seconds. However, im stuck to this .. How could I start the loop to start the countdown when a starStopButton is pressed and reset to 24 again when restButton is pressed. Thanks
const int clockPin = 3;
const int dataPin = 2;
const int startStopButton = 4;
const int resetButton = 5;
static byte displayDigit[10]= {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
void setup()
{
Serial.begin(9600);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(startStopButton, INPUT);
pinMode(resetButton, INPUT);
initDisplay();
}
void loop()
{
}
void initDisplay()
{
shiftOut(dataPin,clockPin,MSBFIRST,0x66);
shiftOut(dataPin,clockPin,MSBFIRST,0x5b);
}