r/ArduinoHelp • • Aug 01 '25

Help with an if loop

(SOLVED)

Hello i need help with my if loop, i want to make it so that it checks if the "on" variable is true

it looks like this right now:

if (on == true)

my error message says this:

Compilation error: 'on' was not declared in this scope

does some know please how to fix this?

Oh yeah and i put the code in the loop void thing and i also made this before the if loop:

bool on = false;

im kinda new here so i feel very dumb with this lol

1 Upvotes

3 comments sorted by