From 4d4902069a7646f8e385beca7b96da50d9ff02ea Mon Sep 17 00:00:00 2001 From: gyengus Date: Sun, 10 Dec 2023 18:18:16 +0100 Subject: [PATCH 1/4] Setting up RGB LED for M5 StampS3 device --- platformio.ini | 1 + src/drivers/devices/m5StampS3.h | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 318b84e..848a1bf 100644 --- a/platformio.ini +++ b/platformio.ini @@ -372,6 +372,7 @@ lib_deps = https://github.com/tzapu/WiFiManager.git#v2.0.16-rc.2 mathertel/OneButton @ ^2.0.3 arduino-libraries/NTPClient + https://github.com/FastLED/FastLED lib_ignore = TFT_eSPI SD diff --git a/src/drivers/devices/m5StampS3.h b/src/drivers/devices/m5StampS3.h index a7c4134..fd09fca 100644 --- a/src/drivers/devices/m5StampS3.h +++ b/src/drivers/devices/m5StampS3.h @@ -2,8 +2,9 @@ #define _M5_STAMP_S3_H #define PIN_BUTTON_1 0 -#define LED_PIN 9 +#define RGB_LED_PIN 21 -#define NO_DISPLAY +#define LED_DISPLAY +#define USE_LED -#endif \ No newline at end of file +#endif From 675f251a1ad486215322b3e6f921fde354efcb6a Mon Sep 17 00:00:00 2001 From: Julio MATARRANZ Date: Wed, 13 Dec 2023 18:43:25 +0100 Subject: [PATCH 2/4] feat : add support to c3 devices (mini ai-c3 and c3 super mini, 24khs) and refactor rgb led devices --- platformio.ini | 71 +++++++++++++++++++++-- src/drivers/devices/device.h | 8 +-- src/drivers/devices/esp32DevKit.h | 2 + src/drivers/devices/esp32DevKitRGB.h | 10 ---- src/drivers/devices/esp32RGB.h | 24 ++++++++ src/drivers/devices/esp32S3MiniWeact.h | 10 ---- src/drivers/devices/esp32S3MiniWemos.h | 10 ---- src/drivers/displays/ledDisplayDriver.cpp | 2 +- 8 files changed, 95 insertions(+), 42 deletions(-) delete mode 100644 src/drivers/devices/esp32DevKitRGB.h create mode 100644 src/drivers/devices/esp32RGB.h delete mode 100644 src/drivers/devices/esp32S3MiniWeact.h delete mode 100644 src/drivers/devices/esp32S3MiniWemos.h diff --git a/platformio.ini b/platformio.ini index 318b84e..0ebe7fb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,7 +10,7 @@ [platformio] globallib_dir = lib -default_envs = esp32cam, ESP32-2432S028R, NerminerV2, ESP32-devKitv1, NerminerV2-S3-DONGLE, NerminerV2-S3-AMOLED, NerminerV2-T-QT, NerdminerV2-T-Display_V1, ESP32-2432S028R, M5-StampS3, ESP32-S3-devKitv1, ESP32-S3-mini-wemos, ESP32-S3-mini-weact +default_envs = esp32cam, ESP32-2432S028R, NerminerV2, ESP32-devKitv1, NerminerV2-S3-DONGLE, NerminerV2-S3-AMOLED, NerminerV2-T-QT, NerdminerV2-T-Display_V1, ESP32-2432S028R, M5-StampS3, ESP32-S3-devKitv1, ESP32-S3-mini-wemos, ESP32-S3-mini-weact, ESP32-C3-devKitmv1, ESP32-C3-super-mini ;-------------------------------------------------------------------- @@ -31,7 +31,8 @@ build_flags = -D BOARD_HAS_PSRAM -D ARDUINO_USB_MODE=1 -D ARDUINO_USB_CDC_ON_BOOT=1 - -D S3MINIWEMOS=1 + -D ESP32RGB=1 + -D RGB_LED_PIN=47 ;-D DEBUG_MINING=1 lib_deps = https://github.com/takkaO/OpenFontRender @@ -42,7 +43,6 @@ lib_deps = https://github.com/FastLED/FastLED lib_ignore = TFT_eSPI -;-------------------------------------------------------------------- ;-------------------------------------------------------------------- @@ -62,7 +62,8 @@ build_flags = -D BOARD_HAS_PSRAM -D ARDUINO_USB_MODE=1 -D ARDUINO_USB_CDC_ON_BOOT=1 - -D S3MINIWEACT=1 + -D ESP32RGB=1 + -D RGB_LED_PIN=48 ;-D DEBUG_MINING=1 lib_deps = https://github.com/takkaO/OpenFontRender @@ -75,6 +76,65 @@ lib_ignore = TFT_eSPI ;-------------------------------------------------------------------- +[env:ESP32-C3-super-mini] +platform = espressif32 +board = seeed_xiao_esp32c3 +framework = arduino +monitor_filters = + esp32_exception_decoder + time + log2file +monitor_speed = 115200 +upload_speed = 115200 +board_build.partitions = huge_app.csv +build_flags = + -D BOARD_HAS_PSRAM + -D ARDUINO_USB_MODE=1 + -D ARDUINO_USB_CDC_ON_BOOT=1 + -D DEVKITV1=1 + -D PIN_BUTTON_1=9 + ;-D DEBUG_MINING=1 +lib_deps = + https://github.com/takkaO/OpenFontRender + bblanchon/ArduinoJson@^6.21.2 + https://github.com/tzapu/WiFiManager.git#v2.0.16-rc.2 + mathertel/OneButton @ ^2.0.3 + arduino-libraries/NTPClient +lib_ignore = + TFT_eSPI +;-------------------------------------------------------------------- + +[env:ESP32-C3-devKitmv1] +platform = espressif32 +board = esp32-c3-devkitm-1 +framework = arduino +monitor_filters = + esp32_exception_decoder + time + log2file +monitor_speed = 115200 +upload_speed = 115200 +board_build.partitions = huge_app.csv +build_flags = + -D BOARD_HAS_PSRAM + -D ARDUINO_USB_MODE=1 + -D ARDUINO_USB_CDC_ON_BOOT=1 + -D ESP32RGB=1 + -D PIN_BUTTON_1=9 + -D RGB_LED_PIN=8 + ;-D DEBUG_MINING=1 +lib_deps = + https://github.com/takkaO/OpenFontRender + bblanchon/ArduinoJson@^6.21.2 + https://github.com/tzapu/WiFiManager.git#v2.0.16-rc.2 + mathertel/OneButton @ ^2.0.3 + arduino-libraries/NTPClient + https://github.com/FastLED/FastLED +lib_ignore = + TFT_eSPI + +;-------------------------------------------------------------------- + [env:ESP32-S3-devKitv1] platform = espressif32 board = esp32-s3-devkitc-1 @@ -91,7 +151,8 @@ build_flags = -D BOARD_HAS_PSRAM -D ARDUINO_USB_MODE=1 -D ARDUINO_USB_CDC_ON_BOOT=1 - -D DEVKITV1RGB=1 + -D ESP32RGB=1 + -D RGB_LED_PIN=48 ;-D DEBUG_MINING=1 lib_deps = https://github.com/takkaO/OpenFontRender diff --git a/src/drivers/devices/device.h b/src/drivers/devices/device.h index dc1af80..3d28be9 100644 --- a/src/drivers/devices/device.h +++ b/src/drivers/devices/device.h @@ -21,12 +21,8 @@ #include "esp32CAM.h" #elif defined(M5_STAMP_S3) #include "m5StampS3.h" -#elif defined(DEVKITV1RGB) -#include "esp32DevKitRGB.h" -#elif defined(S3MINIWEMOS) -#include "esp32S3MiniWemos.h" -#elif defined(S3MINIWEACT) -#include "esp32S3MiniWeact.h" +#elif defined(ESP32RGB) +#include "esp32RGB.h" #else #error "No device defined" diff --git a/src/drivers/devices/esp32DevKit.h b/src/drivers/devices/esp32DevKit.h index 41b92e3..b79872c 100644 --- a/src/drivers/devices/esp32DevKit.h +++ b/src/drivers/devices/esp32DevKit.h @@ -1,7 +1,9 @@ #ifndef _ESP32_DEV_KIT_H #define _ESP32_DEV_KIT_H +#ifndef PIN_BUTTON_1 #define PIN_BUTTON_1 0 +#endif #define LED_PIN 2 #define NO_DISPLAY diff --git a/src/drivers/devices/esp32DevKitRGB.h b/src/drivers/devices/esp32DevKitRGB.h deleted file mode 100644 index b6597c9..0000000 --- a/src/drivers/devices/esp32DevKitRGB.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _ESP32_DEV_KIT_RGB_H -#define _ESP32_DEV_KIT_RGB_H - -#define PIN_BUTTON_1 0 -#define RGB_LED_PIN 48 - -#define LED_DISPLAY -#define USE_LED - -#endif \ No newline at end of file diff --git a/src/drivers/devices/esp32RGB.h b/src/drivers/devices/esp32RGB.h new file mode 100644 index 0000000..523e0dc --- /dev/null +++ b/src/drivers/devices/esp32RGB.h @@ -0,0 +1,24 @@ +#ifndef _ESP32_RGB_H +#define _ESP32_RGB_H + +#ifndef PIN_BUTTON_1 +#define PIN_BUTTON_1 0 +#endif + +#ifndef RGB_LED_PIN +#define RGB_LED_PIN 48 +#endif + +#ifndef RGB_LED_CLASS +#define RGB_LED_CLASS WS2812B +#endif + +#ifndef RGB_LED_ORDER +#define RGB_LED_ORDER BGR +#endif + + +#define LED_DISPLAY +#define USE_LED + +#endif \ No newline at end of file diff --git a/src/drivers/devices/esp32S3MiniWeact.h b/src/drivers/devices/esp32S3MiniWeact.h deleted file mode 100644 index 0a25f5a..0000000 --- a/src/drivers/devices/esp32S3MiniWeact.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _ESP32_S3_MINI_WEACT_H -#define _ESP32_S3_MINI_WEACT_H - -#define PIN_BUTTON_1 0 -#define RGB_LED_PIN 48 - -#define LED_DISPLAY -#define USE_LED - -#endif \ No newline at end of file diff --git a/src/drivers/devices/esp32S3MiniWemos.h b/src/drivers/devices/esp32S3MiniWemos.h deleted file mode 100644 index f32b7c4..0000000 --- a/src/drivers/devices/esp32S3MiniWemos.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _ESP32_S3_MINI_WEMOS_H -#define _ESP32_S3_MINI_WEMOS_H - -#define PIN_BUTTON_1 0 -#define RGB_LED_PIN 47 - -#define LED_DISPLAY -#define USE_LED - -#endif \ No newline at end of file diff --git a/src/drivers/displays/ledDisplayDriver.cpp b/src/drivers/displays/ledDisplayDriver.cpp index 86dd79e..fd45e18 100644 --- a/src/drivers/displays/ledDisplayDriver.cpp +++ b/src/drivers/displays/ledDisplayDriver.cpp @@ -28,7 +28,7 @@ void ledDisplay_Init(void) { Serial.println("Led display driver initialized"); #ifdef USE_LED - FastLED.addLeds(&leds, 1); + FastLED.addLeds(&leds, 1); FastLED.show(); #endif // USE_LED } From e9275c066dc555d47893fcfcc801c18bfdca9bda Mon Sep 17 00:00:00 2001 From: Julio MATARRANZ Date: Wed, 27 Dec 2023 22:42:50 +0100 Subject: [PATCH 3/4] feat : add custom led pin to devkit1 --- src/drivers/devices/esp32DevKit.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drivers/devices/esp32DevKit.h b/src/drivers/devices/esp32DevKit.h index b79872c..b10aa61 100644 --- a/src/drivers/devices/esp32DevKit.h +++ b/src/drivers/devices/esp32DevKit.h @@ -4,7 +4,10 @@ #ifndef PIN_BUTTON_1 #define PIN_BUTTON_1 0 #endif + +#ifndef LED_PIN #define LED_PIN 2 +#endif #define NO_DISPLAY From b1b3ca3a22487fdb1e22e47784852eb651243b43 Mon Sep 17 00:00:00 2001 From: Julio MATARRANZ Date: Wed, 27 Dec 2023 22:45:25 +0100 Subject: [PATCH 4/4] fix : changed esp32 C3 super mini led pin --- platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/platformio.ini b/platformio.ini index 0ebe7fb..57e79c8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -93,6 +93,7 @@ build_flags = -D ARDUINO_USB_CDC_ON_BOOT=1 -D DEVKITV1=1 -D PIN_BUTTON_1=9 + -D LED_PIN=8 ;-D DEBUG_MINING=1 lib_deps = https://github.com/takkaO/OpenFontRender