Shop OBEX P1 Docs P2 Docs Learn Events
Help needed pls,How do i scan single input — Parallax Forums

Help needed pls,How do i scan single input

staffshomestaffshome Posts: 28
edited 2009-09-18 17:07 in BASIC Stamp
Hi all,
i need to scan a single input as part of my app ( like debounce for multiple input )been through manual but i cannot seem to find the answer.I think POLLIN is the answer but i· got very confused trying to implement code.
need to scan pin 3 to get 2 solutions.
oop's forgot to say bs2p

Regards Adrian


Post Edited (staffshome) : 9/18/2009 7:37:35 AM GMT

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2009-09-18 14:03
    For monitoring a single pin, look at the BUTTON command.

    You can also monitor a single pin with INx, a group 4 pins with INA, INB,INC,IND, and a group of 8 pins with INL or INH.

    Good explanation of each of these in the Help file in the Stamp programming environment.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • dev/nulldev/null Posts: 381
    edited 2009-09-18 14:05
    You question is a little unclear. Did you try
    IF IN3 = 1 THEN ' HIGH
       ' do something
    ELSE ' LOW
       ' do something else
    ENDIF
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • staffshomestaffshome Posts: 28
    edited 2009-09-18 17:07
    Hi all,

    thanks for replies,

    yes you are correct using INL would work as im usind INB already & can cut out some lines & subroutines but i'm having trouble getting INL to Run ( problem with variables i think ???)

    Has anyone got an example of INL to get me Started,i used this to get on right track with INB

    ·File...... SW21-EX14-Debounce.BS2
    '·· Purpose... SCANNING AND DEBOUNCING MULTIPLE INPUTS
    '·· Author.... Parallax Stamp Works EXPERIMENT #14

    But no info on using INL inputs 0-7, i tried to mod my working INB but not getting anywhere

    Regards Adrian
Sign In or Register to comment.