system
August 4, 2011, 11:00am
1
I've got the following problem, I want to use 5 pir modules that have to open 5 valves, each pir controls 1 valve.
pretty straight forward, but here comes the problem,
If pir 1 is high, valve 1 needs to open for 6 seconds, but how can I read the other pir states now?
system
August 4, 2011, 11:02am
2
If pir 1 is high, valve 1 needs to open for 6 seconds, but how can I read the other pir states now?
Why is this a problem? If you are using delay() to hold the valve open, find a baseball bat and whack yourself a few times. Then, look at the blink without delay example.
system
August 4, 2011, 11:04am
3
but when one of the pir's is high and in the delay() the other ons can't do anything am I right?
system
August 4, 2011, 11:09am
4
Absolutely right.
So don't use "delay".
system
August 4, 2011, 11:11am
5
but how should I do it then? I still need to be able to control the other four valves when one is already open.
system
August 4, 2011, 11:14am
6
Open the IDE, click on "file", "examples", "digital", "BlinkWithoutDelay"
Play with it; understand it.