looking for code advice...Am i doing this right?
Brian Carpenter
Posts: 728
in Propeller 1
'in earlier spot in code cntr := (RTC.ReadTimeReg(2)) PUB HourlyMeter IF cntr <> (RTC.ReadTimeReg(2)) slot[cntr] := volume volume := 0 IF cntr < 23 cntr ++ else cntr := 0
RTC.ReadTimeReg(2) returns the hours
cntr is a byte variable
volume is a byte variable
Slot[23] is also a variable.
what I am trying to accomplish is each time the hour changes, I want to write the value of volume (this is a value that cumulates as the rain gauge tips) to its appropriate slot variable so that at the end of the day I can do a dump to my sms (in different section off code)
does it look right?
Comments
John Abshier
VAR
LONG slot[23]
This makes an array of 23 elements from slot[0] to slot[22]
John Abshier
thx