From 584fa688c3c68589e5b34817642d349dcceeb3d3 Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Tue, 11 Jul 2023 23:16:10 +0200 Subject: [PATCH] use pre-defined led pin --- src/esp_clock.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/esp_clock.cpp b/src/esp_clock.cpp index 7d9c4ff..b4131dc 100644 --- a/src/esp_clock.cpp +++ b/src/esp_clock.cpp @@ -21,7 +21,6 @@ Task tButton(TASK_IMMEDIATE, TASK_ONCE, onButtonCallback, &ts); #include "ir.h" #define BUTTON D3 -#define LED D4 void setup() { @@ -42,7 +41,7 @@ void setup() { pinMode(BUTTON, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(BUTTON), onButtonPressed, FALLING); - attachInterrupt(digitalPinToInterrupt(LED), onLed, CHANGE); + attachInterrupt(digitalPinToInterrupt(LED_BUILTIN), onLed, CHANGE); } void loop() { @@ -74,7 +73,7 @@ ICACHE_RAM_ATTR void onButtonPressed() { } ICACHE_RAM_ATTR void onLed() { - Mqtt::publish(Mqtt::ledMqtt->stateTopic, digitalRead(LED) ? "OFF" : "ON"); + Mqtt::publish(Mqtt::ledMqtt->stateTopic, digitalRead(LED_BUILTIN) ? "OFF" : "ON"); } void onButtonCallback() {