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) -![]()
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.
Dave, something like
If so then how do I set the value for the variable alarm ?Code:HEXRTCHour = RTCHour & $70 if alarm & $70 = HEXRTCHour then alarmled=1 endif
Thanks for the offer of some assistance. If you prefer to drop me a pm with e-mail addy, it might save space on the forum server ? - there is also no rush...
Bookmarks