Hi Paul,
thanks for the reply.
I was using "if" statements initially, but couldnt get the LED's to light up at all. (Simply by substituting the "if" with "while" they started reading). I'll change them back to "if"!
Using:
if (acc > 10) digitalWrite(LED1, HIGH); //this value can be upto 1023 (this is the nalog input converted to digital signal)
delay(3000);
if (acc < 1) digitalWrite(LED1, HIGH);
delay(3000);
if (therm > 10) digitalWrite(LED1, HIGH);
delay(3000);
if (therm < 1) digitalWrite(LED1, HIGH);
delay(3000);
The LED turns on for 3 seconds. But by using "delay" am I correct in thinking that a button/switch press will do nothing until after the delays are finished?
What code would I use so that a button/switch press whilst LED 1 is on reverts it back to monitoring the acc/therm inputs, and if nothing is pressed then LED 2 illuminated after 5 seconds?
Would I use "millis" instead of "delay"?