From 1148d0d1526908231f8f52bda8fa118330d94541 Mon Sep 17 00:00:00 2001 From: Evert Arias Date: Sat, 11 Apr 2020 01:55:26 -0400 Subject: [PATCH] Document clean up --- examples/Sequence/Sequence.ino | 6 ++++-- examples/TouchButton/TouchButton.ino | 15 ++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/Sequence/Sequence.ino b/examples/Sequence/Sequence.ino index 4e8de98..7282fe2 100644 --- a/examples/Sequence/Sequence.ino +++ b/examples/Sequence/Sequence.ino @@ -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. diff --git a/examples/TouchButton/TouchButton.ino b/examples/TouchButton/TouchButton.ino index 99fa888..11df68d 100644 --- a/examples/TouchButton/TouchButton.ino +++ b/examples/TouchButton/TouchButton.ino @@ -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(); }