Built-in RGB led Demo
2025.04.25 14:12
/*
BlinkRGB ; Here, the key is to use constant RGB_BUILTIN
Demonstrates usage of onboard RGB LED on some ESP dev boards.
Calling digitalWrite(RGB_BUILTIN, HIGH) will use hidden RGB driver.
RGBLedWrite demonstrates control of each channel:
void rgbLedWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val)
WARNING: After using digitalWrite to drive RGB LED it will be impossible to drive the same pin
with normal HIGH/LOW level
*/
//#define RGB_BRIGHTNESS 64 // Change white brightness (max 255)
// the setup function runs once when you press reset or power the board
void setup() {
// No need to initialize the RGB LED
}
// the loop function runs over and over again forever
void loop() {
#ifdef RGB_BUILTIN
digitalWrite(RGB_BUILTIN, HIGH); // Turn the RGB LED white
delay(1000);
digitalWrite(RGB_BUILTIN, LOW); // Turn the RGB LED off
delay(1000);
rgbLedWrite(RGB_BUILTIN, RGB_BRIGHTNESS, 0, 0); // Red
delay(1000);
rgbLedWrite(RGB_BUILTIN, 0, RGB_BRIGHTNESS, 0); // Green
delay(1000);
rgbLedWrite(RGB_BUILTIN, 0, 0, RGB_BRIGHTNESS); // Blue
delay(1000);
rgbLedWrite(RGB_BUILTIN, 0, 0, 0); // Off / black
delay(1000);
#endif
}
Comment 0
No. | Subject | Author | Date | Views |
---|---|---|---|---|
Notice | For the first time user of ESP32-S3 super mini users. | me | 2025.04.25 | 44 |
11 |
Object Pascal App getting data from ESP32-S3 (Parsing)
![]() | me | 2025.04.29 | 43 |
10 |
Sound Sensor Test
![]() | me | 2025.04.27 | 41 |
9 |
Laser distance sensor VL53L0X
![]() | me | 2025.04.27 | 37 |
8 |
9DOF : Getting Pitch & Roll with ICM20948 v2
![]() | me | 2025.04.27 | 40 |
7 |
Formating output
![]() | me | 2025.04.27 | 34 |
6 | Blinking Built-in RGB without delay() | me | 2025.04.25 | 39 |
» | Built-in RGB led Demo | me | 2025.04.25 | 42 |
4 | Servo Demo | me | 2025.04.25 | 40 |
3 |
HMC5883L Compass demo
![]() | me | 2025.04.25 | 39 |
2 |
I2C Address Search
![]() | me | 2025.04.25 | 37 |
1 | Serial Sample (ASCII Table) | me | 2025.04.25 | 39 |