Description:
Debounce example checks the state of PUSH2 on G2 LaunchPads and toggles the green LED based on the button being pushed using 'time' filtering to eliminate extraneous button pushes or noise. As delivered, the example does nothing to the green LED regardless of the button being pushed or not.
Changing:
Issue opened: here.
This post was made so as to inform users trying to implement software debouncing in accordance with the example.
Debounce example checks the state of PUSH2 on G2 LaunchPads and toggles the green LED based on the button being pushed using 'time' filtering to eliminate extraneous button pushes or noise. As delivered, the example does nothing to the green LED regardless of the button being pushed or not.
Changing:
void setup() {
pinMode(buttonPin, INPUT);
pinMode(ledPin, OUTPUT);
}... to ...void setup() {
pinMode(buttonPin, INPUT_PULLUP); // <--- note the change to "INPUT_PULLUP"
pinMode(ledPin, OUTPUT);
}... corrects the issue: the green LED is on unless the button is pushed.Issue opened: here.
This post was made so as to inform users trying to implement software debouncing in accordance with the example.