
Originally Posted by
Amoque
You spoke in your original post of an "easier way", while this is not exactly what you asked, I find it easier and so offer...
Keeping track of hours and minutes separately is unnecessary. For me, over and again, I have determined that a word value representing the minutes since midnight (a value of 0 to 1440) is clearer and easier to manipulate.
... just a thought.
I agree and that's the way I do the matching of the if then statements. The code reads the RTC, and the end result is placed in two variables, TimeH and TimeM. Then the TimeH is multiplied by 60 and added to TimeM and placed in a variable Counter1. I then have a similar statement CH1_on_Time = (lightsetHR1*60)+lightsetMN1 to convert the values in the above statement which are then placed in a variable, and then it's a simple matter to do the actions required depending on if the two variables match or one is < or > than other.
Oh and just to update this thread, and for reference for anyone in the future who may stumble on this thread...
Code:
address =$50
for counterd = 0 to 15
read (address),lightsetHR(counterD),lightsetMN(counterD),lightoffHR(counterD),lightoffMN(counterD),fadeset.lowbyte(counterD),fadeset.highbyte(counterD)
address = address+6 ' account for the data already filled into the storage
next counterD
With the the matching WRITE command, works a treat
- thanks Jerson ;-)
Bookmarks