Shop OBEX P1 Docs P2 Docs Learn Events
Reading and storing inputs using INA — Parallax Forums

Reading and storing inputs using INA

ArchiverArchiver Posts: 46,084
edited 2002-01-28 13:37 in General Discussion
Does anyone know how I could read three inputs, high or low, that are
never being read at the same time, and store each input in a nibble
for later comparison. I have a ps2sx being used to freqout and read 3
individual IR's for directional control of a mouse. I want to later
compare the nibble created from the inputs to control the output to
two motors.
If anyone has any ideas they would be greatly appreciated.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-01-28 13:37
    Here is code to break down a single nibble variable into smaller bit
    variables. should do the trick for you.

    MyNib VAR Nib
    Bita var MyNib.bit0
    Bitb var MyNib.bit1
    Bitc var MyNib.bit2

    bita = IN8
    bitb = IN9
    bitc = IN10

    debug dec MyNib,CR

    -Martin Hebel
    http://www.selmaware.com/stampplot


    --- In basicstamps@y..., "pl97f500" <pl97f500@h...> wrote:
    > Does anyone know how I could read three inputs, high or low, that
    are
    > never being read at the same time, and store each input in a nibble
    > for later comparison. I have a ps2sx being used to freqout and read
    3
    > individual IR's for directional control of a mouse. I want to later
    > compare the nibble created from the inputs to control the output to
    > two motors.
    > If anyone has any ideas they would be greatly appreciated.
Sign In or Register to comment.