Arduino-GPIO
General Purpose Input/Output (GPIO) library for Arduino
Button.ino
Go to the documentation of this file.
1 #include "GPIO.h"
2 #include "Button.h"
3 
5 
6 void setup()
7 {
8  Serial.begin(57600);
9  while (!Serial);
10 }
11 
12 void loop()
13 {
14  if (button.ischanged()) {
15  Serial.print(button.timestamp());
16  Serial.print(':');
17  Serial.println(button ? F("released") : F("pushed"));
18  }
19 }
Definition: Button.h:31
void setup()
Definition: Button.ino:8
bool ischanged()
Definition: Button.h:50
Button< BOARD::D1 > button
Definition: Button.ino:6
Software::Serial< BOARD::D0 > Serial
Definition: Button.ino:5
void loop()
Definition: Button.ino:14
uint16_t timestamp()
Definition: Button.h:86