Skip to content

Commit 7135d17

Browse files
committed
feat(board): Add onboard LED support for Waveshare ESP32-S3 Zero
Defines the standard LED_BUILTIN and RGB_BUILTIN macros for the Waveshare ESP32-S3 Zero, allowing its onboard WS2812 RGB LED to be controlled via standard Arduino APIs.
1 parent ae634a9 commit 7135d17

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

variants/waveshare_esp32_s3_zero/pins_arduino.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22
#define Pins_Arduino_h
33

44
#include <stdint.h>
5+
#include "soc/soc_caps.h"
56

67
#define USB_VID 0x303a
78
#define USB_PID 0x822B
89
#define USB_MANUFACTURER "Waveshare"
910
#define USB_PRODUCT "ESP32-S3-Zero"
1011
#define USB_SERIAL "" // Empty string for MAC address
1112

12-
// Partial voltage measurement method
13+
// Onboard WS2812 RGB LED
1314
#define WS_RGB 21
1415

16+
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
17+
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + WS_RGB;
18+
#define BUILTIN_LED LED_BUILTIN // backward compatibility
19+
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
20+
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
21+
#define RGB_BUILTIN LED_BUILTIN
22+
#define RGB_BRIGHTNESS 64
23+
1524
// Mapping based on the ESP32S3 data sheet - alternate for OUTPUT
1625
static const uint8_t OUTPUT_IO1 = 1;
1726
static const uint8_t OUTPUT_IO2 = 2;

0 commit comments

Comments
 (0)