AnalogWrite not working in If Statement

Code: [Select]

analogWrite(analogOutPin, LOW);

nonsense!
Code: [Select]

analogWrite(analogOutPin, 0);

Perhaps!

You need to look at the source of analogWrite for the AVR processors, particularly for an argument of zero (aka LOW) :wink: