Matching time conditions


Closed Thread
Results 1 to 40 of 49

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Something like
    Code:
    HEXRTCHour = RTCHour $ $70
    Should convert the BCD into HEX
    I think....
    Dave
    Always wear safety glasses while programming.

  2. #2
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    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) -

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    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.

  4. #4
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Hmm..

    This is from one of mine to change the I2C output to HEX then display the DEC via serial.
    Dave - I note your deliberate mistake to keep me on my toes

    Code:
    HEXRTCHour = RTCHour $ $70
    Code:
    SEC_T = sec & $70
    Thanks - that's compiled - will now go away and play

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Dave - I note your deliberate mistake to keep me on my toes
    That was not deliberate... dirty bifocals
    Dave
    Always wear safety glasses while programming.

  6. #6
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    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.

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    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.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts