Shop OBEX P1 Docs P2 Docs Learn Events
DIRS and OUTS — Parallax Forums

DIRS and OUTS

NewzedNewzed Posts: 2,503
edited 2004-07-23 23:37 in BASIC Stamp
If I write:

DIRH = 1
OUTH = 0

will that make pins 8-15 outputs and set them all low?

Sid

Comments

  • K de JongK de Jong Posts: 154
    edited 2004-07-23 23:22
    Hi Sid,

    To my opinion (and that of the Stamp manual :-): yes, that should work that way!

    Regards and success,jumpin.gif

    Klaus
    Newzed said...
    If I write:

    DIRH = 1
    OUTH = 0

    will that make pins 8-15 outputs and set them all low?

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-23 23:30
    No, that will only make P8 go low. What you want to do is this:

    OUTH = %00000000
    DIRH = %11111111

    Using binary values when working with multiple IO pins helps "visualize" what's going on. Your code is doing this:

    DIRH = %00000001
    OUTH = %00000000

    ... so now you can see why only P8 is being made an output.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • NewzedNewzed Posts: 2,503
    edited 2004-07-23 23:31
    Thanks, Klaus.· Been busy - haven't looked at your data logging thing but I will.

    Bespreking aan u later

    Sid
  • NewzedNewzed Posts: 2,503
    edited 2004-07-23 23:37
    Thanks, Jon.· Just wan't thinking.

    Sid
Sign In or Register to comment.