I have one pole going to the PIN5 (digital input) on the arduino, and the other going to the +5V line.
Where do I wire ground to with the 10K pulldown resistor? I was able to make this work with a tactile push button but that had 4 legs, so I am unsure what to do here. I am not an electrical engineer by any stretch of the imagination - so pardon my ignorance.
#include "Arduino.h"
// 1. Include the library
#include "EButton.h"
// 2. Instantiate the object and attach it to PIN 5
EButton button(5);
// 3. Handler method for a single-click
void singleClick(EButton &btn) {
Serial.println("We have a single-click!");
}
void setup() {
Serial.begin(115200);
// 4. Attach the handler
button.attachSingleClick(singleClick);
Serial.println("\nClick or double-click!");
}
void loop() {
// 5. Tick the object in a loop
button.tick();
}