Shop OBEX P1 Docs P2 Docs Learn Events
Stamp PLC questions — Parallax Forums

Stamp PLC questions

shazzamshazzam Posts: 2
edited 2007-05-31 14:03 in General Discussion
I have a Stamp PLC controller with a BS2 chip. What I am trying to do is make a simple program to get the basics down first.

This is what I have:

Main:
DO
LOW 15
PAUSE 250
HIGH 15
PAUSE 250
LOOP UNTIL (Din1 = 1) ‘I want the flashing LED to stop when Din1 is pressed

The biggest problem I have is figuring out what Din1 thru Din10 is called. Obviously Din1 is not the correct name, because it hasn’t stopped flashing… What am I missing?

Post Edited By Moderator (Chris Savage (Parallax)) : 5/30/2007 10:40:01 PM GMT

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-30 22:44
    Hello,

    Eight of the inputs go to a shift register, not directly to an I/O pin, so to read these you must first SHIFTIN the data. Two inputs do go directly so if you connect to those, you could use the following code to detect a signal going into Din9 or Din10…

    LOOP UNTIL IN6 = 0

    Or

    LOOP UNTIL IN7 = 0

    Note: The inputs are active LOW, so by default they should be HIGH. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • shazzamshazzam Posts: 2
    edited 2007-05-31 14:03
    That works great, Thanks. Now that you have explained Din1 - 8, and how it works, it makes things much easier.
Sign In or Register to comment.