Last active
May 11, 2016 22:13
-
-
Save rhettc/125254c246c3c08907c974d6350f7d1d to your computer and use it in GitHub Desktop.
Extract Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setupButton(int pin, Bounce debouncer) | |
{ | |
pinMode(pin, INPUT_PULLUP); | |
// configure the de-bounce for this button | |
debouncer.attach(pin); | |
debouncer.interval(5); | |
} | |
void setup() { | |
Serial.begin(19200); //DEBUGGING ONLY | |
setupButton(BUTTON_PIN_1, debouncer1); | |
setupButton(BUTTON_PIN_2, debouncer2); | |
setupButton(BUTTON_PIN_3, debouncer3); | |
setupButton(BUTTON_PIN_4, debouncer4); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment