How can I change this code so:
if fanOff is pushed the fan comes on and when pushed again the fan turns off?
No need to worry about switch bounce or time between pushes. Thanks for the help.
fanOff is a push button attached to a digital input.
if (pushed_fanOff) {//push button to shut down fan
digitalWrite(fanRelay, LOW);//turn relay off
digitalWrite(fanLed, LOW);