Hi guys,
I have four variables in my code that are words as I need to store numbers between 0 and 1439. That part is fairly straight forward and I can manually enter "White_on_Time =840" and "White_off_Time = 1230" etc However I want to use some pre-sets in my code via the data statement. This works fine with byte variables but I can't for the life of me get correct value into the variable via the data / read statements.
I've tried "data word" and then the values but that fails, so consulting the manual I tried the READ (variable).byte
Code:
read 10,Blue_on_Time.0
read 11,Blue_on_Time.1
But that didn't work either.
The strange thing is I have a menu option to set these values thus
Code:
Lcdout $FE,2
LCDOUT $FE,$80,"Set On Time For "
IF H_butt = 0 THEN GOSUB delHours
IF M_butt = 0 THEN GOSUB delMinutes
lightsetHR[fn]=Hours
lightsetMN[fn]=Minutes
if viv >=2 then viv =2
if viv= 1 then LCDOUT $FE,$C0,"Blue Leds "
if viv= 2 then LCDOUT $FE,$C0,"white Leds "
lcdout $FE,$94,#lightsetHR[fn] DIG 1,#lightsetHR[fn] DIG 0,":",#lightsetMN[fn] DIG 1,#lightsetMN[fn] DIG 0
Blue_on_Time = (lightsetHR[0]*60)+lightsetMN[0]
White_on_Time = (lightsetHR[1]*60)+lightsetMN[1]
/snip
If I left the read / write as normal (ie without the 1st byte / 2nd byte modifier) and set the time to 14:00 hrs (ie (14*60)+0 = 840)via the menu option it works. I have a test line on the LCD which shows the dec value for blue_on_time is 840.
Any pointers as to what I'm doing wrong ?
Bookmarks