Scampy,
Use the regular Division "/" operator for the Hours computation and use the Modulo "//" operator for the minutes computation.
lightsetHR1 = (CH1_on_time / 60)
lightsetMN1 = (CH1_on_time // 60)
Cheers,
Scampy,
Use the regular Division "/" operator for the Hours computation and use the Modulo "//" operator for the minutes computation.
lightsetHR1 = (CH1_on_time / 60)
lightsetMN1 = (CH1_on_time // 60)
Cheers,
Regards,
TABSoft
Hi
My mistake
the line lightsetHR1=lightsetHR1/60 ' you get the integer part your example =14
should be lightsetHR1=CH1_on_time/60 ' you get the integer part your example =14
then it produces the same results with the more elegant way that Tabsoft suggests.
But I think that we should have used another new variable instead of CH1_on_time lets say Time_read_from_timer
Then either way once you get the time from DS1307 you can split it into hours and minutes and then go on displaying it.
Bill
Thanks for the replies. If I get stuck I'll be back![]()
Bookmarks