I set up a simple code to tell me if the button was pressed or not. When I get within a foot of the Arduino the button triggers. I first noticed this when trying to trigger a servo with a button. I've now had 3 different Arduinos, and every time if there is any button input, when I get close it says the button is pressed. I've searched this everywhere and can't find the reason. If anyone has any remote idea please tell me.

  • 5
    Floating input? Do you have a pull up or pull down resistor, or are you using INPUT_PULLUP? – Majenko Jul 20 '20 at 6:40

Browse other questions tagged or ask your own question.