TolpuddleSartre:
val = analogRead(A0);
Serial.println(val);
if (val == 1)
The chances of an analogRead consistently returning a one are pretty remote.
That’s the part OP modified compared to original source code.. OP’s innovation and contribution...