From fda5c6ff27a5cf29a5597946d113e4b68deb0538 Mon Sep 17 00:00:00 2001 From: Magnus Persson Date: Thu, 31 Mar 2022 16:51:27 +0200 Subject: [PATCH] Enable blue LED when running on ESP32 --- src/main.cpp | 4 +++- src/main.hpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 53fa3c7..5805fda 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -129,6 +129,8 @@ void setup() { } snprintf(&buf[0], sizeof(buf), "%6x", chipId); Log.notice(F("Main: Started setup for %s." CR), &buf[0]); + pinMode(PIN_LED, OUTPUT); + digitalWrite(PIN_LED, HIGH); #endif printBuildOptions(); @@ -290,7 +292,7 @@ bool loopReadGravity() { } return true; } else { - Log.error(F("MAIN: No gyro value found, the device might be moving.")); + Log.error(F("MAIN: No gyro value found, the device might be moving." CR)); } return false; } diff --git a/src/main.hpp b/src/main.hpp index cb5f895..cbd5cac 100644 --- a/src/main.hpp +++ b/src/main.hpp @@ -35,6 +35,7 @@ SOFTWARE. #define PIN_SDA D3 #define PIN_SCL D4 #define PIN_DS D6 +#define PIN_LED 2 //#define PIN_A0 A0 #else // defined (ESP32) #if defined (ESPRESSIF32_20) @@ -51,6 +52,7 @@ SOFTWARE. #define PIN_SCL 16 #define PIN_DS 19 #define PIN_A0 36 +#define PIN_LED 2 #endif #define PIN_LED 2