I have written some code to power a fan system and although it appears to work fine, I have a really strange issue with one of the variables.
The variable in question is “FanRun”
In my project “FanRun” can only be 0 (for off) or 1 (for on), yet when I run it on my circuit I get a Serial.print return of almost any value.
I have just uploaded it into my Uno PCB with no other inputs connected and I am getting “FanRun” returning as 2 and sometimes 3.
Anyone see an obvious fault in my code (attached)?
Fume_1_0c.ino (13.4 KB)