unable to control the on-board RBG on my ESP32-S3

druisaard
Posts: 2
Joined: Mon Jul 03, 2023 2:37 pm

unable to control the on-board RBG on my ESP32-S3

Postby druisaard » Mon Jul 03, 2023 4:48 pm

Using Arduino 1.8 with AI IOT/Dual Type-C USB/WS2812B RGB/ESP32-WHO/CH343P
ESP32-S3 WIFI+BLE5.0 Development Board
ESP32-S3-WROOM-1-N16R8(16M Flash/8SRAM)
https://www.aliexpress.com/item/3283552 ... 1802f7U6y0
The following code lights up the on-board RBG LED in white:

Code: Select all

define onboard RGB_BUILTIN
void setup() {
	Serial.begin(115200);
	while (!Serial);
	delay(1000);
	
	Serial.println();
	Serial.print("On Board LED: ");
	Serial.print(onboard);

	Serial.println();
	
  pinMode(onboard,OUTPUT); 
}
void loop() {
  delay(1000);
  digitalWrite(onboard,HIGH);
  delay(100);
  digitalWrite(onboard,LOW);
}
But the Serial output states that the “RBG_BUILTIN” definition is 97! How can THAT be? Indeed … substituting “97” in place of the “onboard” references, the code still blinks the onboard RBGT LED white.

The pinout I have for my ESP32-S# show GIOP38 to the RGB LED … and this was “confirmed” by forum entry “Incorrect pin definition for the LED blink example on the ESP32-S3-DEVKITC-1”. If, instead of this simple blink code, I try code which “should” exercise the RBG LED:

Code: Select all

#include <FastLED.h>

#define NUM_LEDS 1

#define DATA_PIN 38

// Define the array of leds
CRGB leds[NUM_LEDS];

void setup() {	
	Serial.begin(115200);
	while(!Serial);
	
	Serial.println();
	delay(1000); 
	Serial.println("Started");

	FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);  // GRB ordering is typical
}

void loop() {
	// Turn the LED on, then pause
	leds[0] = CRGB::Red;
	FastLED.show();
	delay(500);
	// Now turn the LED off, then pause
	leds[0] = CRGB::Black;
	FastLED.show();
	delay(500);
}
The onboard RBG does NOTHING … Please help. It could be the ESP32-S3 board I’m using which actually has the RGB LED on another GPIO… I have tried several but to no avail. I have also tried the NeoPixel library and code from Adafruit… still no results


druisaard
Posts: 2
Joined: Mon Jul 03, 2023 2:37 pm

Re: unable to control the on-board RBG on my ESP32-S3

Postby druisaard » Sun Jul 09, 2023 4:25 pm

Thanks so much ... the GitHub code works perfectly. Interesting, apparently the "neopixelWrite" is a "built-in" function. Really? Any idea where the reference to this function (which library ... "ESP32"?) contains this function?

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: unable to control the on-board RBG on my ESP32-S3

Postby lbernstone » Mon Jul 10, 2023 6:05 am

It is core (C-code), not a library.
https://github.com/espressif/arduino-es ... -rgb-led.h

Who is online

Users browsing this forum: No registered users and 56 guests