Made the code more readable and native.

This commit is contained in:
Johannes Findeisen 2023-08-08 08:48:29 +02:00
commit f6d0db5d87
2 changed files with 66 additions and 64 deletions

View file

@ -21,8 +21,10 @@
// The button pin
#define BUTTON_PIN 0
// The LED pin
#define LED_PIN 1
// The pause after last button press before executing a command
#define PAUSE 2000
@ -30,8 +32,8 @@
unsigned long last;
unsigned int count;
// Create blinker object
Blinker blinker(LED_PIN);
// Create Blinker object
Blinker Blinker(LED_PIN);
void setup() {
// Set button pin to high.
@ -41,9 +43,9 @@ void setup() {
digitalWrite(BUTTON_PIN, HIGH);
// Set blink effect (ON, OFF) in milliseconds
blinker.setDelay(25, 9075);
Blinker.setDelay(25, 9075);
// Start LED blink effect
blinker.start();
Blinker.start();
// Initialize HID
DigiKeyboard.delay(0);
@ -58,7 +60,7 @@ void setup() {
void loop() {
// Invoke the Blinker
blinker.blink();
Blinker.blink();
// Read button state
if (digitalRead(BUTTON_PIN) == LOW) {