I've been losing my mind trying to find the color key for the Nano ESP32's RGB LED. Through troubleshooting various boards the last few months, I've probably gotten over 10 different color/flash variants, and often several cycling at once. I assume their purpose is to help me troubleshoot, but they're not much use if I don't have a key. Is it a trade secret or something?
From this page:
https://docs.arduino.cc/tutorials/nano-esp32/cheat-sheet/
This quote:
Some boards from the first limited production batch were assembled with a different RGB LED which has the green and blue pins inverted. Read our full Help Center article here
Contains this link:
Sorry if I did not understand your question.
You can display various colors using PWM by keeping a frequency of say 60 and for example a duty cycle of 0 - 1000.
The three individual leds are active low so the brightness will be inversely proportional to the duty cycle.
The following should give a magenta color, it's micropython but it should be obvious whats going on.
r = PWM(Pin(46)) #D14
g = PWM(Pin(0)) #D15
b = PWM(Pin(45)) #D16
def set_r(level):
r.freq(60)
r.duty(level)
def set_g(level):
g.freq(60)
g.duty(level)
def set_b(level):
b.freq(60)
b.duty(level)
set_r(500)
set_g(1000)
set_b(500)
equates to rgb(255,0,255)