Shop OBEX P1 Docs P2 Docs Learn Events
Decimal to BCD help... — Parallax Forums

Decimal to BCD help...

ArchiverArchiver Posts: 46,084
edited 2001-10-23 12:03 in General Discussion
I have a BS2 and am wanting to convert a decimal (stored in a variable) to a
binary-coded-decimal number (for BCD-7segdisplay purposes). Any ideas on how to
do that? I have not found anything in that manual, but maybe I missed something.
Any help is always appreciated...


[noparse][[/noparse]Non-text portions of this message have been removed]

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-10-23 04:52
    Look up the DIG command. If I understand you correctly, this will do what
    you want.

    Regards,


    Al Williams
    AWC
    * Control 8 servos at once
    http://www.al-williams.com/awce/pak8.htm

    >
    Original Message
    > From: Astro Fizzix [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=RdXwLDzlOEjGb5PyYQiZmbMyMtbKiPODXXxQGDMsFM7djlRdkuALUnpK7SfKX0g1q-VbtOnpgyPNuoh2TyiH2P8]astro_fizzix@y...[/url
    > Sent: Monday, October 22, 2001 9:45 PM
    > To: Post BS Message
    > Subject: [noparse][[/noparse]basicstamps] Decimal to BCD help...
    >
    >
    > I have a BS2 and am wanting to convert a decimal (stored in a
    > variable) to a binary-coded-decimal number (for BCD-7segdisplay
    > purposes). Any ideas on how to do that? I have not found anything
    > in that manual, but maybe I missed something. Any help is always
    > appreciated...
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
    >
    >
    > 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 2001-10-23 12:03
    You can use the DIG operator to get the individual digit values from your
    variable and the segment patterns for the displays can be stored in DATA
    statements.

    -- Jon Williams
    -- Parallax


    In a message dated 10/22/01 9:46:56 PM Central Daylight Time,
    astro_fizzix@y... writes:


    > I have a BS2 and am wanting to convert a decimal (stored in a variable) to a
    > binary-coded-decimal number (for BCD-7segdisplay purposes). Any ideas on
    > how to do that? I have not found anything in that manual, but maybe I
    >




    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.