Shop OBEX P1 Docs P2 Docs Learn Events
Monotoring of 8 lines — Parallax Forums

Monotoring of 8 lines

BernardJPBernardJP Posts: 4
edited 2005-03-24 19:09 in BASIC Stamp
Hi,
Using BS2sx, I'm expecting to scan 8 lines connected to 8 ports ( positive logic, "1" remaining less than 700mS on one or two lines simultaneouly ).
Trial using BUTTON instructions in an endless loop let me catch no more yhan 5 lines faultless.
Have you a better idea ???
Regards,
Bernard

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-24 17:26
    Isn't there a way to just read in all 8 if they are on the same port? Someone with experience in PBASIC please confirm if·this is true.

    Post Edited (Paul Baker) : 3/24/2005 5:29:59 PM GMT
  • BeanBean Posts: 8,129
    edited 2005-03-24 17:42
    Yes, just use INL or INH or even INS (to monitor all 16). I haven't tested this, but something like:

    temp VAR byte

    temp=INL
    Again:
    If INL = temp THEN Again
    ' here is any of the 8 input changed

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video Display Module" Available Now.

    www.sxvm.com

    "A problem well defined, is a problem·half solved."
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-24 18:03
    Bean has the best idea, and if you're running out of IO pins you can use a 74HC165 shift register to turn three IO pins into eight inputs. Download StampWorks for complete details and code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • BernardJPBernardJP Posts: 4
    edited 2005-03-24 19:09
    Many thanks to Paul; Bean and yourself Jon !
    I'm just reading and understanding Experiment #15 founded in StampWorks and later experimenting !
    Best Regards,
    Bernard
Sign In or Register to comment.