Hi,
I need some help with a school project. So basically, when I press the button I can control the leds with a potentiometer. When I don't press the button, I want to change to color of the neopixel with the potentiometer. The only problem is, the neopixel only works one time (when I send the code to my Arduino). I don't know how to solve the problem. Can somebody please help me?
Eindopdracht_versie5.ino (2.28 KB)
How is the button pin wired ?
Do you have a resistor keeping it at a known state when it is not pressed or is it floating at a voltage that may be HIGH or may be LOW and may even change ?
Google floating inputs and consider setting the pinMode() of the input to INPUT_PULLUP to activate the built in pullup resistor in the Arduino and wiring the pin to be taken LOW when the button is pressed
Hi,
Thank you for your answer but I just fixed the problem! The mistake was in my code
Good news that you fixed it but my question is still relevant