Convert to decimal
Arch
Posts: 2
Using the template from DS1302template.bs2, and then having it the real time clock displayed on my LCD appmod Terminal, however I am missing the digits 8 and 9. Meaning that for the seconds, it goes from 40, 41, 42, 43, 44, 45, 46, 47, 40, 41, 50.
I understand that it has got to do with converting of BCD to decimal value. I've tried a few ways that were mentioned in the previous forum.. none of them really works.. Could anyone advise me on this?
I understand that it has got to do with converting of BCD to decimal value. I've tried a few ways that were mentioned in the previous forum.. none of them really works.. Could anyone advise me on this?
Comments
Thanks Mike. I've attached my file. Anyway, This is the portion of the code where LCD_Date is displaced. Many thanks
LCD_Date:
GOSUB ClearScreen
value = (hrs >> 4) * 10 + (hrs & $0F) 'To set the display of hours to LCD appmod, convert to ASCII before writiing.
GOSUB C_ASCII
value = (mins >> 4) * 10 + (mins & $0F)
GOSUB C_ASCII
value = (secs >> 4) * 10 + (secs & $0F)
GOSUB C_ASCII
RETURN
char = "@"
call Write_LCD_Char
char = "A"
call Write_LCD_Char
' ... and so on