mirror of
https://github.com/jaksatomovic/esp32-clickwheel.git
synced 2025-08-25 14:28:30 -04:00
first commit
This commit is contained in:
commit
868b14f8c8
286 changed files with 59925 additions and 0 deletions
35
lib/Button2/examples/ButtonLoop/ButtonLoop.ino
Normal file
35
lib/Button2/examples/ButtonLoop/ButtonLoop.ino
Normal file
|
@ -0,0 +1,35 @@
|
|||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "Button2.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BUTTON_PIN 2
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
Button2 button;
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
delay(50);
|
||||
Serial.println("\n\nButton Loop Demo");
|
||||
|
||||
button.begin(BUTTON_PIN);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
void loop() {
|
||||
button.loop();
|
||||
|
||||
|
||||
Serial.println(button.clickToString(button.wait()));
|
||||
Serial.println(button.getNumberOfClicks());
|
||||
|
||||
|
||||
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////
|
Loading…
Add table
Add a link
Reference in a new issue