I'm looking to create a custom menu item like the feeding mode where it will run a certain function over and over again until the timer is at 0 then it will go back to normal. Can someone point me in the right direction for this or provide me with some sample code?
Thanks
Custom menu item
Re: Custom menu item
Start here. http://forum.reefangel.com/viewtopic.php?f=14&t=311
Read the guide. It explains a lot and should get you started in the right direction. You may also want to look in the examples that get installed with the Arduino Reef Angel Installer. They are located at File -> Sketchbook -> Examples.
Read the guide. It explains a lot and should get you started in the right direction. You may also want to look in the examples that get installed with the Arduino Reef Angel Installer. They are located at File -> Sketchbook -> Examples.
Re: Custom menu item
Try this:
Code: Select all
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <ReefAngel.h>
prog_char menu1_label[] PROGMEM = "My Custom Function";
PROGMEM const char *menu_items[] = {
menu1_label};
void MenuEntry1()
{
ReefAngel.Timer[1].Start();
ReefAngel.DisplayedMenu=RETURN_MAIN_MODE;
}
void setup()
{
ReefAngel.Init(); //Initialize controller
ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));
ReefAngel.Timer[1].SetInterval(4);
}
void loop()
{
if (!ReefAngel.Timer[1].IsTriggered() && ReefAngel.Timer[1].Trigger!=0) MyCustomFunction();
ReefAngel.ShowInterface();
}
void MyCustomFunction()
{
// Do Something
}
Roberto.