Using a Basic Stamp 1 I/O to control the other I/Os as outputs
profjkar
Posts: 1
Hi all,
I am having problems making this work. I could use the help if anyone else has seen this before.
I want to use one I/O from a Basic Stamp 1 to sequence the remaining I/O ports as outputs.
For example: If I put an input signal in P0, P1 will go high for .5 seconds and go low. If I put a second hi on P0, P2 will go high for .5 seconds and so on for the rest of the I/Os.
I can make one I/O work, but it stops there.
Please help.
Thanks,
Jim K
I am having problems making this work. I could use the help if anyone else has seen this before.
I want to use one I/O from a Basic Stamp 1 to sequence the remaining I/O ports as outputs.
For example: If I put an input signal in P0, P1 will go high for .5 seconds and go low. If I put a second hi on P0, P2 will go high for .5 seconds and so on for the rest of the I/Os.
I can make one I/O work, but it stops there.
Please help.
Thanks,
Jim K
Comments
You're proposing a "state machine" where the Stamp program has a different "state" depending on how many times P0 has gone high.
Look at the Wikipedia article on "state machine" for a description. In this case, each state is a loop to test for P0 going high probably using a PULSIN statement. The "transition" from one state to another pulses P1 or P2 or ... for 1/2 second, probably using a PULSOUT statement.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
You'd also need to change the FOR loop since there are only 8 I/O pins, not 16.
You might want to initialize your I/O pins as follows: