Something like
Should convert the BCD into HEXCode:HEXRTCHour = RTCHour $ $70
I think....
Something like
Should convert the BCD into HEXCode:HEXRTCHour = RTCHour $ $70
I think....
Dave
Always wear safety glasses while programming.
Dave, thanks for the reply, but I get a syntax error with that no matter how format it, (even added a HexRTCHour var byte in the code) -![]()
Hmm..
This is from one of mine to change the I2C output to HEX then display the DEC via serial.
Code:I2CRead DS_SDA, DS_SCL, RTC, SecReg, [sec,MINs,hr,day,date,mon,yr] SEC_T = sec & $70 SEC_T = SEC_T>>4 'Tens place Serout2 PORTC.6, 16572,["SEC_T ",DEC SEC_T, $d, $a] SEC_O = sec & $0F 'Ones place Serout2 PORTC.6, 16572,["SEC_O ",DEC SEC_O, $d, $a]
Dave
Always wear safety glasses while programming.
That was not deliberate... dirty bifocalsDave - I note your deliberate mistake to keep me on my toes![]()
Dave
Always wear safety glasses while programming.
LOL -
Dave, whist I can display the DEC value using and LCD using that code, I still can't apply it to a variable that can be worked with,
any ideas... I simply want something like alarmhour= DEC(HEXRTCHour). It seems that whilst you can use DEC to convert and display a value or send a value via coms, you can't directly apply it.
I was thinking not to worry about comparing to a DEC. Convert the BCD and compare to the conversion.
If you can not get a solution I will work something up when I get back to the shop tonight.
Dave
Always wear safety glasses while programming.
Bookmarks