Go Down

Topic: Crazy buttons. (Read 682 times) previous topic - next topic


I am working with an arduino DUE with industrial servo motors.

I need to attach 6 buttons, the problem is, sometimes these buttons activates himself alone (blink). Why it could be? The fact that it's working in a hard enviorment?

Also, to activate the buttons, I need a pull-down, so I implemented via software a !pullup.

pinMode(B1, INPUT_PULLUP);

Joystick.state.buttons.b00 = !digitalRead(B1);

Is it right? or is it silly? Should be better craft an phisical pull-down with a correct resistor? I don't know how INPUT_PULLUP works inside a DUE.

I would appreciate any help, thanks. 


Apr 03, 2018, 01:45 pm Last Edit: May 12, 2018, 06:16 pm by ard_newbie
If your switch is activated randomly, hook a pull-down resistor to avoid EMI (VCC is 3.3V for a DUE):

Next is the debouncing issue:


Ok, I implemented a physical pull-down and now it works perfect.


Go Up