Hi All, would you help with above part of code I'm guessing its incorrect brackets. Thanks
void menuItem4() { // Function executes when you select the 4th item from main menu
int activeButton = 0;
while (1) {
DateTime now = rtc.now(); //Attaches now to action1 scope
lcd.clear();
lcd.setCursor(4, 0);
lcd.print(now.hour(),DEC);
lcd.print(':');
lcd.print(now.minute(),DEC);
lcd.print(':');
lcd.print(now.second(),DEC);
delay(1000);
}
while (activeButton == 0) {
int button;
readKey = analogRead(0);
if (readKey < 790) {
delay(100);
readKey = analogRead(0);
}
button = evaluateButton(readKey);
switch (button) {
case 4: // This case will execute if the "back" button is pressed
button = 0;
activeButton = 1;
break;
}
}
}
its almost working as I would like so now I can go to menuItem4 which its the Clock but can't go back to main menu all other menus working correctly.Thanks
can't copy another item as only this one have function added to achieve to show RTC in that menu the rest working fine without that function , I can display time without but than clocks not moving forward (not updating live),Thanks
Oh, good! Your editor works. So copy again one of the other menuItem blocks, and then paste your RTC code into it. When you're done, test it and post the revised sketch if it doesn't work.
ok so when going in to menuItem4 ("Clock") I can see the time but seconds not counting (frozen) when moving back to menu and after 2 sec going back to menuItem4 I can see time was changed by that 2 sec , if you know what I mean