Uhmm maybe I spoke too soon...
I have a menu section, which in tern selects sub menus to set the various variables up and then return back to the main menu. The last option of the main menu is this
Code:
LCDOUT $FE,1
Gosub SetButtonRelease
Lcdout $FE,2
LCDOUT $FE,$80,"Saving Settings"
for fn= 0 to 3
write (10*fn + 80),lightsetHR[fn]
write (10*fn + 81),lightsetMN[fn]
write (10*fn + 82),lightoffHR[fn]
write (10*fn + 83),lightoffMN[fn]
write (10*fn + 84),droptemp[fn]
write (10*fn + 85),normtemp[fn]
write (10*fn + 86),StartHour[fn]
write (10*fn + 87),StartMin[fn]
write (10*fn + 88),StopHour[fn]
write (10*fn + 89),StopMin[fn]
write (10*fn + 90),alarmhigh[fn]
Write (10*fn + 91),alarmlow[fn]
next fn
pause 150
goto main
which when selected should write all the variables to memory before going to the main program.
On powerup the values are read back in as part of the initialisation
Code:
for fn= 0 to 3
read (10*fn + 80),lightsetHR[fn]
Read (10*fn + 81),lightsetMN[fn]
Read (10*fn + 82),lightoffHR[fn]
Read (10*fn + 83),lightoffMN[fn]
Read (10*fn + 84),droptemp[fn]
Read (10*fn + 85),normtemp[fn]
Read (10*fn + 86),StartHour[fn]
Read (10*fn + 87),StartMin[fn]
Read (10*fn + 88),StopHour[fn]
Read (10*fn + 89),StopMin[fn]
Read (10*fn + 90),alarmhigh[fn]
Read (10*fn + 91),alarmlow[fn]
next fn
the strange thing is that the normaltemp, alarmhigh and alarmlow values don't appear to of been saved (or are being misread in some way).
Interestingly, the data view doesn't show anything at 80
Bookmarks