// // Simple sketch, to test this library // #include "Switcher.h" // let's blink the LED to signify life const int LED_PIN = 13; // ### sometimes 9 static void callback(const int button, const bool double_tap) { const bool err = (button == -1); #if 1 Serial.print("press: "); if (err) Serial.print("ERROR"); else Serial.print(button); Serial.print("\r\n"); #endif } void setup() { Serial.begin(9600); Serial.println("-- SETUP --"); switcher_setup(); pinMode(LED_PIN, OUTPUT); } void loop() { switcher_work(callback); delay(1000); static int last_value = 0; digitalWrite(LED_PIN, last_value = !last_value); }