Shop OBEX P1 Docs P2 Docs Learn Events
reading value on a specific pin — Parallax Forums

reading value on a specific pin

ArchiverArchiver Posts: 46,084
edited 2003-04-16 12:21 in General Discussion
how can i read a DC(0 or 5V) input from a specific pin?

Here is what we have:
Our basic stamp will be supplying either a high or a low to pin 13.
From here we want to be able to read from pin 9 to see if pin 13 is on
or off. This sounds trivial I know, but I need to be able to do this.

So far when we tried the SERIN command. It will not read the DC
voltage (on or off 5v). Is there another command, and if so how would
it be done.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-04-16 12:21
    Connect pin 9 and 13 together via a 10k resistor, then in your code...

    set pin 13 as output and pin 9 as input...

    code sample...

    if in 9 = 1 then dosomething ' will do something if the pin 13 is high
    'put code here for when pin 13 is low.

    dosomething: 'put code here for when pin is high.

    Someone else may have a simpler answer, but this should work.

    Cheers,
    Chris - West Oz




    Original Message
    From: "jagal1979" <jagal1979@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, April 16, 2003 2:13 PM
    Subject: [noparse][[/noparse]basicstamps] reading value on a specific pin


    > how can i read a DC(0 or 5V) input from a specific pin?
    >
    > Here is what we have:
    > Our basic stamp will be supplying either a high or a low to pin 13.
    > From here we want to be able to read from pin 9 to see if pin 13 is on
    > or off. This sounds trivial I know, but I need to be able to do this.
    >
    > So far when we tried the SERIN command. It will not read the DC
    > voltage (on or off 5v). Is there another command, and if so how would
    > it be done.
    >
    >
    > 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/
    >
    >
Sign In or Register to comment.