Page 1 of 1

memory update daily?

Posted: Sun Jan 08, 2017 3:05 pm
by troylong45
will this update and/or reupdate every day ? i have sun location code and sun rise and set. and need this to up date every day

what i need is i want to have cloud start after StdLightsOnHour,StdLightsOnMinute
and stop befor StdLightsOffHour,StdLightsOffMinute

same with my updateled relay on off time

Code: Select all

	     #define Mem_B_LedHrOn             102 //edit to update storm and led on/off time
        #define Mem_B_LedMinOn            103 //edit to update storm and led on/off time
        #define Mem_B_LedHrOff            104 //edit to update storm and led on/off time
        #define Mem_B_LedMinOff           105 //edit to update storm and led on/off time
InternalMemory.write(Mem_B_LedHrOn,InternalMemory.StdLightsOnHour_read());      //mb102  
 //edit to update storm and led on/off time
InternalMemory.write(Mem_B_LedMinOn,InternalMemory.StdLightsOnMinute_read());   //mb103   
//edit to update storm and led on/off time
InternalMemory.write(Mem_B_LedHrOff,InternalMemory.StdLightsOffHour_read());    //mb104   
//edit to update storm and led on/off time
InternalMemory.write(Mem_B_LedMinOff,InternalMemory.StdLightsOffMinute_read()); //mb105   
//edit to update storm and led on/off time
I uploaded and checked mem b and only shows 255 or mem I shows -1 In all slots

Re: memory update daily?

Posted: Fri Jan 13, 2017 3:54 pm
by troylong45
Bump

Re: memory update daily?

Posted: Sat Jan 14, 2017 7:49 am
by lnevo
Not enough code to know what you're doing. The SunLocation default updates the standardlight on/off times

Re: memory update daily?

Posted: Wed Feb 01, 2017 5:23 am
by troylong45
I was wanting my cloud code start and end times to read from the white channel on off times

Re: memory update daily?

Posted: Sun Feb 05, 2017 10:30 am
by AlanM
I don't think it's a good idea to put something in your loop that writes to internal memory. I think there are a finite amount of writes for those memory locations before they go bad, so best to preserve them.

Re: memory update daily?

Posted: Tue Feb 07, 2017 12:32 pm
by binder
you can write to the internal memory daily to store values but make sure that code is tested. alan is correct, there is only a finite amount of writes allowed in each memory block before the hardware wears out and that block is no good. i made a goof a few years ago with the libraries and was continuously writing to one memory location. it was ok at first but it caused some locations to wear out and thus we had to fix the bug and move memory locations.

so if you do write values out, limit the amount of times you write the values. but be forewarned, if you start getting random values when reading from those locations, the locations may be worn out and dead. they have a pretty high life (maybe 5-10 years worth of writes if you write once a day....not sure the exact amount, just going off of a vague memory and further looking into would be needed for the exact amount)


Sent from my iPad using Tapatalk

Re: memory update daily?

Posted: Tue Feb 14, 2017 6:33 pm
by troylong45
I just wanted the geolocation for the sunrise and sunset to do the same for cloud start after and end befor times just like sun up and sun down so maybe just read from std light and whatever the other one is?