Update README.md
This commit is contained in:
parent
ed5c02f142
commit
5c2d27f7dd
26
README.md
26
README.md
@ -1,24 +1,22 @@
|
|||||||
This library is intended to interact with button pluged on a ESP8266 using the Arduino SDK
|
This library is intended to interact with button pluged on a ESP8266 using the Arduino SDK
|
||||||
|
|
||||||
Code Example
|
Code Example
|
||||||
```Arduino
|
```c++
|
||||||
#include <HIB.h>
|
#include <HIB.h>
|
||||||
|
|
||||||
HIB *button ;
|
HIB *button;
|
||||||
HIB *button2 ;
|
HIB *button2;
|
||||||
|
|
||||||
void onButtonPressed(uint8_t pin){
|
void onButtonPressed(uint8_t pin) { Serial.printf("Button %d pressed \n", pin); }
|
||||||
Serial.printf("Sketch on button %d pressed \n", pin);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setup() {
|
|
||||||
Serial.begin(115200);
|
|
||||||
// put your setup code here, to run once:
|
|
||||||
button = new HIB(0, HIGH, onButtonPressed);
|
|
||||||
button2 = new HIB(4, HIGH, onButtonPressed);
|
|
||||||
|
|
||||||
|
void setup()
|
||||||
|
{
|
||||||
|
Serial.begin(115200);
|
||||||
|
// put your setup code here, to run once:
|
||||||
|
button = new HIB(0, HIGH, onButtonPressed);
|
||||||
|
button2 = new HIB(4, HIGH, onButtonPressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user