Shop OBEX P1 Docs P2 Docs Learn Events
Ignoring an input for awhile? — Parallax Forums

Ignoring an input for awhile?

jeff2.0jeff2.0 Posts: 24
edited 2009-12-30 05:28 in BASIC Stamp
Stamp 2
ver 2.5

I have a project that I must read an input that is triggered when a light comes on (through a relay).
But I must then·flash that same light that was·triggering the input (with a separate output) without retrigging the input again until the flashing is completed.

So I need to put the input "on ignore" for awhile.

Any suggestions?



·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-12-30 05:21
    You don't "put the input 'on ignore'". You simply write your code so that it doesn't check the input. The Stamp input pins provide the status of the input signal at the moment the input pins are referenced.

    You're talking about a program that has two states. One is the normal state where it periodically checks an input and does something when the input is present. The other state is after something is done where it may check other inputs or just wait for a time before returning to the first state.

    Each state is a loop in your program and your program just goes from one loop to the other and back as things happen.
  • jeff2.0jeff2.0 Posts: 24
    edited 2009-12-30 05:28
    So If I start out with: "If input x is 1 THEN GOSUB y"
    But while in GOSUB y, it doesn't matter what the input state is.

    Easier that I thought !

    Thanks Mike!!!
Sign In or Register to comment.