Shop OBEX P1 Docs P2 Docs Learn Events
Stamp I/O Problems — Parallax Forums

Stamp I/O Problems

ArchiverArchiver Posts: 46,084
edited 2001-07-25 23:53 in General Discussion
Not sure if you mean the LED keeps blinking or stays on solidly.

If the former, likely cause is I/O 1 is floating (not connected to
anything when the switch is open). The latter probably happens about
half the time--read the description of TOGGLE again, carefully and
consider what would happen if the latest TOGGLE set I/O 7 low.

Regards,

Steve

On 25 Jul 01 at 20:59, mhr_54@h... wrote:

> Dear Stampers,
>
> I'm using the following code to allow me to turn a blinking LED on
> and off with a switch:
>
> again:
> if in0 = 1 then again
> toggle 7
> pause 200
> goto again
>
> But when I ran the program, even if the switch was in the off
> position the LED was still lit...

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-07-25 21:59
    Dear Stampers,

    I'm using the following code to allow me to turn a blinking LED on
    and off with a switch:

    again:
    if in0 = 1 then again
    toggle 7
    pause 200
    goto again

    But when I ran the program, even if the switch was in the off
    position the LED was still lit. I tested the switch and it was fine.
    The only explanation I have is that the Stamp is grounding the LED
    with out being told to do so.

    I've added the schematic I used in the files archive on this mailing
    list.

    Please help.

    Thanks,
    mhr_54
  • ArchiverArchiver Posts: 46,084
    edited 2001-07-25 23:53
    You need to make sure pin 1 is set for input and pin 7 is set for output.

    Original Message

    > I'm using the following code to allow me to turn a blinking LED on
    > and off with a switch:
    >
    > again:
    > if in0 = 1 then again
    > toggle 7
    > pause 200
    > goto again
    >
    > But when I ran the program, even if the switch was in the off
    > position the LED was still lit. I tested the switch and it was fine.
    > The only explanation I have is that the Stamp is grounding the LED
    > with out being told to do so.
Sign In or Register to comment.