Shop OBEX P1 Docs P2 Docs Learn Events
Disconnecting Pin? — Parallax Forums

Disconnecting Pin?

RatatoskrRatatoskr Posts: 12
edited 2008-05-30 02:16 in BASIC Stamp
This is probably a really numb question...

For a program, I need to set a pin HIGH then disconnect it from HIGH a short time later. I've looked through the index of PBASIC syntax, no luck there.

More specifically, there are 6 pins grouped in this circuit, leading to an array of switches. I need to set each pin HIGH individually then disconnect it again before the next pin is set to HIGH. That way I can tell which switches are closed and the program knows which pin the HIGH originated from. Since the pins are linked, if one is set LOW it would take a full 5V short circuit with no resistors. Not okay. If the pin stays HIGH, I can't read the switches properly.

I might be able to rewire this to separate them so they don't mix or go back, but a way to do this in the software would be better than messing with hardware.

I just need a DISCONNECT Pin15 sort of thing, they start off disconnected, so there should be a way to set it?

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-05-29 21:07
    HIGH 0 will make P0 and output HIGH.
    INPUT 0 will then make the pin an INPUT, effectively disconnecting its output driver. Is this what you needed?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • RatatoskrRatatoskr Posts: 12
    edited 2008-05-30 02:16
    Yes, exactly. Thanks!

    I think I might have some "legacy wiring" that is unnecessary and causing this issue as well, but that's good to know.
Sign In or Register to comment.