Shop OBEX P1 Docs P2 Docs Learn Events
Timer and hex conversion problem — Parallax Forums

Timer and hex conversion problem

ArchiverArchiver Posts: 46,084
edited 2003-11-06 17:17 in General Discussion
I'm receiving time data from the Basic Pocket Watch B module, as directed in
the easy to follow instructions. I receive data quite well. I am using a
BS2.

However, I need convert the time, which is received in hex format, to
decimal.

I read the manual, lots of info, but none that I can say directly relates to
my problem.

I tried adding a dec statement to the serin statement, and the serin threw
up an error flag.

I tried converting the hex to decimal using algebraic type equasions. No
luck.

Anyone tried this before?

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-11-06 16:59
    Hi Grover,

    Take a look at an151.zip which can be found on this page:

    http://www.warburtech.com/Modules/Pocket%20Watch%20B/Pocket%20Watch%20B.htm

    I hope this helps. If you have any further questions, please let me know.

    Best regards,

    Russell Warburton
    email: russell@w...
    website: http://www.warburtech.com
    telephone: +44 (0)7814 044 754
    Original Message
    From: "Grover Richardson" <grover.richardson@g...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, November 06, 2003 4:36 PM
    Subject: [noparse][[/noparse]basicstamps] Timer and hex conversion problem


    > I'm receiving time data from the Basic Pocket Watch B module, as directed
    in
    > the easy to follow instructions. I receive data quite well. I am using a
    > BS2.
    >
    > However, I need convert the time, which is received in hex format, to
    > decimal.
    >
    > I read the manual, lots of info, but none that I can say directly relates
    to
    > my problem.
    >
    > I tried adding a dec statement to the serin statement, and the serin threw
    > up an error flag.
    >
    > I tried converting the hex to decimal using algebraic type equasions. No
    > luck.
    >
    > Anyone tried this before?
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-11-06 17:17
    >I'm receiving time data from the Basic Pocket Watch B module, as directed in
    >the easy to follow instructions. I receive data quite well. I am using a
    >BS2.
    >
    >However, I need convert the time, which is received in hex format, to
    >decimal.
    >
    >I read the manual, lots of info, but none that I can say directly relates to
    >my problem.
    >
    >I tried adding a dec statement to the serin statement, and the serin threw
    >up an error flag.
    >
    >I tried converting the hex to decimal using algebraic type equasions. No
    >luck.
    >
    >Anyone tried this before?

    Hex to decimal conversion follows the pattern...
    hour = $13 ' 1 pm hex (BCD)
    debug hex2 hour,CR

    hour = hour.nib1*10 + hour.nib0 ' 1 pm decimal
    debug dec2 hour,CR

    -- Tracy
Sign In or Register to comment.