Shop OBEX P1 Docs P2 Docs Learn Events
4 Push Buttons — Parallax Forums

4 Push Buttons

ArchiverArchiver Posts: 46,084
edited 2002-12-10 10:22 in General Discussion
Hello Stamp Programmers:

I am working on a system that use N O Push buttons active low. Can anyone
tell me if it is possible to convert

the indications to DEC. instead of Binary. For example what I have now is
1111 I would like to display this information

in DEC 0,1,2,3 and on the same line like binary. I am using The BS2E
Chip. I would appreciate any information

you can give me with sample code.

Harry.

E-mail HR518@ Juno.Com

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-12-08 21:39
    In a message dated 12/08/2002 16:27:55 Eastern Standard Time, HR518@J...
    writes:


    > I am working on a system that use N O Push buttons active low. Can anyone
    > tell me if it is possible to convert
    >
    > the indications to DEC. instead of Binary. For example what I have now is
    > 1111 I would like to display this information
    >
    > in DEC 0,1,2,3 and on the same line like binary. I am using The BS2E
    > Chip. I would appreciate any information
    >
    >

    Don't really understand what yiu want - if you want a "2" displayed if you
    push button 2, then

    If in0 = 1 then but2

    but2:
    serout 16, N9600, [noparse][[/noparse]"2", cr]

    goto start

    Something like that, perhaps?


    Sid Weaver
    W4EKQ
    Port Richey, FL


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-12-09 23:17
    You can, but not as cleanly. Try this:

    DEBUG DEC buttons.Bit3 * 4
    DEBUG DEC buttons.Bit2 * 3
    DEBUG DEC buttons.Bit1 * 2
    DEBUG DEC buttons.Bit0 * 1

    Each position will display 0 or its position value.

    -- Jon Williams
    -- Parallax


    In a message dated 12/8/2002 3:27:33 PM Central Standard Time, HR518@J...
    writes:

    > Hello Stamp Programmers:
    >
    > I am working on a system that use N O Push buttons active low. Can anyone
    > tell me if it is possible to convert
    >
    > the indications to DEC. instead of Binary. For example what I have now is
    > 1111 I would like to display this information
    >
    > in DEC 0,1,2,3 and on the same line like binary. I am using The BS2E
    > Chip. I would appreciate any information
    >
    > you can give me with sample code.
    >
    > Harry.



    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-12-10 10:22
    Hello Jon:

    Thanks for The information on the Push Buttons.

    You are tops in my Book.

    Harry

    12/10/02
Sign In or Register to comment.