Waiting for inputs
Blackbird455
Posts: 124
I know I haven't stirred up anything in a while..............been real busy.........
· I want a BS1 to take inputs and respond like this:
(not using proper syntax for a stamp I know........been up for over 24 hours)
if
pin1=1
pin2=1
pin1=1
pin2=1
then start 'within a scope of lets say 5 seconds, and after it takes· this in, I will follow it woth an output.
start
....
....
....
if
pin2=1
pin1=1
pin2=1
pin1=1
then stop
stop
....
....
....
if this isnt enough info to "get my drift" then I will be back on around 1800 cst tonight.
If you have a code example, that would be very helpful.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Noli nothis permittere te terere
· I want a BS1 to take inputs and respond like this:
(not using proper syntax for a stamp I know........been up for over 24 hours)
if
pin1=1
pin2=1
pin1=1
pin2=1
then start 'within a scope of lets say 5 seconds, and after it takes· this in, I will follow it woth an output.
start
....
....
....
if
pin2=1
pin1=1
pin2=1
pin1=1
then stop
stop
....
....
....
if this isnt enough info to "get my drift" then I will be back on around 1800 cst tonight.
If you have a code example, that would be very helpful.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Noli nothis permittere te terere
Comments
In other words, you say you want to test for pin1=1.
Do you want to wait for it to go back to zero before you test for pin2=1?
Would something like this do?
You'd repeat this again for states 4-7 and then do your start thing.
You could then repeat the same idea with pin1 and pin2 swapped
for the stop control sequence. None of this addresses what you
want to do if you get part way through the state sequence and
make a mistake. In other words, there's no provision for a reset.
You'll have to decide how you want to do that (in terms of what
the user does).