Subversion Repositories ESP8266_P1_Meter

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 raymond 1
/*
2
 * Created by ArduinoGetStarted.com
3
 *
4
 * This example code is in the public domain
5
 *
6
 * Tutorial page: https://arduinogetstarted.com/tutorials/arduino-button-library
7
 *
8
 * This example reads the state of a button without debounce and print it to Serial Monitor.
9
 */
10
 
11
#include <ezButton.h>
12
 
13
ezButton button(7);  // create ezButton object that attach to pin 7;
14
 
15
void setup() {
16
  Serial.begin(9600);
17
}
18
 
19
void loop() {
20
  button.loop(); // MUST call the loop() function first
21
 
22
  int btnState = button.getState();
23
  Serial.println(btnState);
24
}