Automatic reboot of RA after set amount of time
-
- Posts: 140
- Joined: Wed Mar 13, 2013 5:36 pm
Automatic reboot of RA after set amount of time
You can reboot from the Android app, so how would I put that into the code to happen after a certain amount of time presumably after the last reboot or power on?
Thank you.
Thank you.
Re: Automatic reboot of RA after set amount of time
All you need to force a reboot is this line:
It will force the watchdog to reboot the controller.
Code: Select all
while(1);
Roberto.
-
- Posts: 140
- Joined: Wed Mar 13, 2013 5:36 pm
Re: Automatic reboot of RA after set amount of time
please, can you tell me where I put this in the code? and does it reboot randomly then? or a certain amount of time?rimai wrote:All you need to force a reboot is this line:It will force the watchdog to reboot the controller.Code: Select all
while(1);
i'm arduino illiterate.
thank you
Re: Automatic reboot of RA after set amount of time
No, the minute this is executed, it will reboot right away.
To force a reboot at a specific time, all you need is this:
To force a reboot at a specific time, all you need is this:
Code: Select all
if (hour()==10 && minute()==0 && second()==0) while(1);
Roberto.
-
- Posts: 140
- Joined: Wed Mar 13, 2013 5:36 pm
Re: Automatic reboot of RA after set amount of time
ok. is there an easier way to say to reboot every 3 hours? or I have to put in 8 of those lines of code?
Re: Automatic reboot of RA after set amount of time
Try this:
Code: Select all
if (now() % 10800 == 0 ) while(1);
Roberto.
-
- Posts: 140
- Joined: Wed Mar 13, 2013 5:36 pm
Re: Automatic reboot of RA after set amount of time
thank you.rimai wrote:Try this:Code: Select all
if (now() % 10800 == 0 ) while(1);
would this conflict?
Code: Select all
if (now()-feeding<5400) {
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(Smart_NTM,75,10);
}