Skip to content

Commit c8d0a9f

Browse files
authored
feat(ledc): Change ledc full brightness to 256
1 parent 69baa14 commit c8d0a9f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libraries/ESP32/examples/AnalogOut/ledcWrite_RGB/ledcWrite_RGB.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const boolean invert = true; // set true if common anode, false if common catho
1717

1818
uint8_t color = 0; // a value from 0 to 255 representing the hue
1919
uint32_t R, G, B; // the Red Green and Blue color components
20-
uint8_t brightness = 255; // 255 is maximum brightness, but can be changed. Might need 256 for common anode to fully turn off.
20+
uint16_t brightness = 255; // 255 is maximum brightness, but can be changed.
2121

2222
// the setup routine runs once when you press reset:
2323
void setup() {
@@ -33,12 +33,12 @@ void setup() {
3333

3434
// void loop runs over and over again
3535
void loop() {
36-
Serial.println("Send all LEDs a 255 and wait 2 seconds.");
36+
Serial.println("Send all LEDs a 256 and wait 2 seconds.");
3737
// If your RGB LED turns off instead of on here you should check if the LED is common anode or cathode.
3838
// If it doesn't fully turn off and is common anode try using 256.
39-
ledcWrite(ledR, 255);
40-
ledcWrite(ledG, 255);
41-
ledcWrite(ledB, 255);
39+
ledcWrite(ledR, 256);
40+
ledcWrite(ledG, 256);
41+
ledcWrite(ledB, 256);
4242
delay(2000);
4343
Serial.println("Send all LEDs a 0 and wait 2 seconds.");
4444
ledcWrite(ledR, 0);

0 commit comments

Comments
 (0)