memory update daily?

Basic / Standard Reef Angel hardware
Post Reply
troylong45
Posts: 203
Joined: Sat Oct 10, 2015 9:17 pm

memory update daily?

Post 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
Image
troylong45
Posts: 203
Joined: Sat Oct 10, 2015 9:17 pm

Re: memory update daily?

Post by troylong45 »

Bump
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: memory update daily?

Post by lnevo »

Not enough code to know what you're doing. The SunLocation default updates the standardlight on/off times
troylong45
Posts: 203
Joined: Sat Oct 10, 2015 9:17 pm

Re: memory update daily?

Post by troylong45 »

I was wanting my cloud code start and end times to read from the white channel on off times
Image
AlanM
Posts: 263
Joined: Wed Jan 01, 2014 7:26 am

Re: memory update daily?

Post 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.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: memory update daily?

Post 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
troylong45
Posts: 203
Joined: Sat Oct 10, 2015 9:17 pm

Re: memory update daily?

Post 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?
Image
Post Reply