hi everyone, I'm Newbie to the arduino world. I need some help with the program.
I need to switch ON four outputs in sequence one by one with a time delay for every output based on a single input(HIGH)..
I used If condition with a for loop , and its working. But the problem is the outputs not getting off immediately based on input state. Once started , its getting off only after completing sequence. I want the outputs to be stopped right away and wait for input. Please help, thank you.
if (X == HIGH ){
for (int Pin = A; Pin < E; Pin++) {
pinMode(Pin, OUTPUT);
digitalWrite(Pin, HIGH);
delay(timer);
digitalWrite(Pin, LOW);}}
hary666:
hi everyone, I'm Newbie to the arduino world. I need some help with the program.
I need to switch ON four outputs in sequence one by one with a time delay for every output based on a single input(HIGH)..
I used If condition with a for loop , and its working. But the problem is the outputs not getting off immediately based on input state. Once started , its getting off only after completing sequence. I want the outputs to be stopped right away and wait for input. Please help, thank you.
if (X == HIGH ){
for (int Pin = A; Pin < E; Pin++) {
pinMode(Pin, OUTPUT);
digitalWrite(Pin, HIGH);
delay(timer);
digitalWrite(Pin, LOW);}}
Try this post
if (X == HIGH ){
for (int Pin = A; Pin < E; Pin++) {
pinMode(Pin, OUTPUT);
digitalWrite(Pin, HIGH);
delay(timer);
digitalWrite(Pin, LOW);
delay(timer);
}}