Do you have a question on how to do something.
Ask in here.
gaberosenfield
Posts: 89 Joined: Thu Mar 08, 2012 5:11 pm
Location: Redwood City, California
Post
by gaberosenfield » Wed Dec 02, 2015 11:38 pm
I have a custom menu set up, but I can't figure out how to give myself the option to set the date/time from the custom menu. Here's what I have so far:
Code: Select all
//Custom Menu Code
prog_char menu0_label[] PROGMEM = "Manual Feed";
prog_char menu1_label[] PROGMEM = "Start AWC";
prog_char menu2_label[] PROGMEM = "Clear Alerts & Vars";
prog_char menu3_label[] PROGMEM = "pH Calibration";
prog_char menu4_label[] PROGMEM = "Toggle All Pumps";
prog_char menu5_label[] PROGMEM = "Set Date and Time";
PROGMEM const char *menu_items[] = {
menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
};
void MenuEntry1()
{
feedsToday += 1;
wp25On = false;
feedingPauseTimer = now();
feeding = true;
}
void MenuEntry2()
{
if (!ReefAngel.IO.GetChannel(0))
{
AWCToday = false;
AWC = true;
}
}
void MenuEntry3()
{
//Clear portal variables.
ReefAngel.CustomVar[Var_AWCCountTotal] = 0;
ReefAngel.CustomVar[Var_AWCCountToday] = 0;
ReefAngel.CustomVar[Var_AWCDrainFail] = 0;
ReefAngel.CustomVar[Var_AWCFillFail] = 0;
ReefAngel.CustomVar[Var_AWCOverflowFail] = 0;
ReefAngel.CustomVar[Var_AWCATOFail] = 0;
//Clear AWC control variables.
AWC = false;
AWCToday = false;
AWCFail = false;
AWCCheck = 0;
AWCDrainCheck = 0;
//Clear ATO timeout.
ReefAngel.ATOClear();
ReefAngel.DisplayMenuEntry("Clear ATO Timeout");
}
void MenuEntry4()
{
ReefAngel.StartSetupCalibrateChoicePH();
}
void MenuEntry5()
{
ReefAngel.WaterChangeModeStart();
}
void MenuEntry6()
{
ReefAngel.DisplayMenuEntry("Item 1");ReefAngel.SetupDateTime();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
What should I do to get this to work?
Thanks,
Gabe
binder
Posts: 2871 Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:
Post
by binder » Thu Dec 03, 2015 5:30 am
your menu entry should only be this.
void MenuEntry6(){
ReefAngel.SetupDateTime();
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE
}
you had an extra line in it.
Sent from my XT1585 using Tapatalk
gaberosenfield
Posts: 89 Joined: Thu Mar 08, 2012 5:11 pm
Location: Redwood City, California
Post
by gaberosenfield » Sat Dec 19, 2015 9:13 pm
Sorry for such a late reply!
I see my original error now. Probably a stupid copy paste error.
I tried your solution. I got an error saying I needed a semicolon after the "ReefAngel.DisplayedMenu = ALT_SCREEN_MODE" line. I added one. Then I uploaded the modified code and it did exactly what my code did originally. When I select the option from the RA, the screen just flashes to a blank screen for a split second and then it takes me back to the menu. I cannot change the time on my RA.
I would just use the RA app to set the time, but I cannot get it to connect. I need to fiddle with my router settings again, but that's another story...
Any other advice on how to get the setup date & time menu option to work?
gaberosenfield
Posts: 89 Joined: Thu Mar 08, 2012 5:11 pm
Location: Redwood City, California
Post
by gaberosenfield » Sun Dec 20, 2015 2:01 pm
Ok, I got my RA app working again. I used it to set the proper time. I still can't do it from the custom menu on the RA though...
binder
Posts: 2871 Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:
Post
by binder » Sun Dec 20, 2015 8:19 pm
hmmmm... i believe it should work. unless something changed in newer versions of the libraries or with the new screen.
Sent from my XT1585 using Tapatalk
rimai
Posts: 12881 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Mon Dec 21, 2015 12:01 am
Try removing this line:
Code: Select all
ReefAngel.DisplayedMenu = ALT_SCREEN_MODE
Roberto.