Shop OBEX P1 Docs P2 Docs Learn Events
inputs and outputs on Basic Stamps — Parallax Forums

inputs and outputs on Basic Stamps

ArchiverArchiver Posts: 46,084
edited 2001-11-11 01:00 in General Discussion
Add "OUTPUT 15" to your initialization. Unlike the HIGH and LOW
instructions, setting OUT15 to a high or low value does not cause
the pin to become an output, it simply sets the output state if/when
the pin is an output.

Regards,

Steve

On 11 Nov 01 at 1:00, rpsu279@y... wrote:

> Hi all,
> The code below show that I was trying to experiment with input and
> output pins of the BSII and IISX. I hooked up pin 15 to a stampworks
> LED. I ran the code with several different connections and in
> several different ways. However, I could not get an LED to flash. I
> need to find the right way to make a pin HIGH when another pin is
> LOW and vice versa. Any input would be appreciated.
>
> Sincerely,
> RP
>
>
> '{$STAMP BS2sx}
> 'supply CON 11
> testIN VAR IN12 'hook that up to pin 11 of bs2
> testOUT VAR OUT15 'send the output through pin 15
>
> 'Low Supply
>
> Main:
> testOUT = ~testIN
> ' If testIn = 1 THEN Low_15
> ' If testIn = 0 THEN High_15
> ' Pause 2000
> ' Toggle Supply
> GOTO Main
> END

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-11-11 01:00
    Hi all,
    The code below show that I was trying to experiment with input and
    output pins of the BSII and IISX. I hooked up pin 15 to a stampworks
    LED. I ran the code with several different connections and in several
    different ways. However, I could not get an LED to flash. I need to
    find the right way to make a pin HIGH when another pin is LOW and
    vice versa. Any input would be appreciated.

    Sincerely,
    RP


    '{$STAMP BS2sx}
    'supply CON 11
    testIN VAR IN12 'hook that up to pin 11 of bs2
    testOUT VAR OUT15 'send the output through pin 15

    'Low Supply

    Main:
    testOUT = ~testIN
    ' If testIn = 1 THEN Low_15
    ' If testIn = 0 THEN High_15
    ' Pause 2000
    ' Toggle Supply
    GOTO Main
    END

    High_15:
    ' testOUT = 1
    HIGH testOUT
    RETURN

    Low_15:
    ' testOUT = 0
    LOW testOUT
    RETURN
Sign In or Register to comment.