Skip to content

Commit

Permalink
Document clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Evert Arias committed Apr 11, 2020
1 parent 4d8a5aa commit 1148d0d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 4 additions & 2 deletions examples/Sequence/Sequence.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@
// Arduino pin where the button is connected to.
#define BUTTON_PIN 26

#define BAUDRATE 115200

// Instance of the button.
EasyButton button(BUTTON_PIN);

// Callback function to be called when the button is pressed.
void onSequenceMatched()
{
Serial.println("Button pressed!");
Serial.println("Button pressed");
}

void setup()
{
// Initialize Serial for debuging purposes.
Serial.begin(115200);
Serial.begin(BAUDRATE);
// Initialize the button.
button.begin();
// Add the callback function to be called when the given sequence of presses is matched.
Expand Down
15 changes: 10 additions & 5 deletions examples/TouchButton/TouchButton.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,29 @@
// Arduino pin where the button is connected to.
#define BUTTON_PIN 27

#define BAUDRATE 115200

// Instance of the button.
EasyButtonTouch button(BUTTON_PIN);

// Callback function to be called when the button is pressed.
void onPressed() {
Serial.println("Button has been pressed!");
void onPressed()
{
Serial.println("Button has been pressed");
}

void setup() {
void setup()
{
// Initialize Serial for debuging purposes.
Serial.begin(115200);
Serial.begin(BAUDRATE);
// Initialize the button.
button.begin();
// Add the callback function to be called when the button is pressed.
button.onPressed(onPressed);
}

void loop() {
void loop()
{
// Continuously read the status of the button.
button.read();
}

0 comments on commit 1148d0d

Please sign in to comment.