Hy everybody,
many thanks in advance at who will tell me where i'm wrong.
I want just control an led, with BUTTON to switch it on and with BUTTON1 to switch it off. If now i run the code the led is still on and no control with buttons.
Thanks again.
Andy.
Hy Pauls,
many many many thanks. I'm starting to work with Arduino and i'm non expert. thanks to your suggestion (==) now is perfectly running.
About to separate the declaration from the initialization, i just copied an example found on the web: is that wrong?
Many thanks again.
Andy.
It isn't right or wrong. It is unnecessary. Keeping the declaration and initialization together makes it clear what type of variable is being used, and uses fewer lines.
int apri = digitalRead(BUTTON);
int chiudi = digitalRead(BUTTON1);