Whenever counter_1 gets the value of 4, Arduino automatically changes that to 1 and so skips the 4th case.
How can I solve this problem?
I m trying to clone time settings of Casio F-91W.
Whenever I push the button, the counter will increase and goes to one left digit that we will change(in this method digits will only blink).
I set 4 cases:
- Second digit blink
- Minute digit blink
- Hour digit blink
- No blink
void updateCounter_1() {
counter_1 = counter_1 + 1;
if (counter_1 == 5) {
counter_1 = 1;
}
}
void settTime(){
switch (counter_1) {
case 1:
lcd.setCursor(6, 1);
lcd.print(" ");
delay(150);
updateHrs();
updateMins();
printSecs();
delay(150);
break;
case 2:
lcd.setCursor(3, 1);
lcd.print(" ");
delay(150);
printMins();
delay(150);
break;
case 3:
lcd.setCursor(0, 1);
lcd.print(" ");
delay(150);
printHrs();
delay(150);
break;
case 4:
break;
}
}