LED less brilliance - better for the eyes
Closed this issue · 2 comments
PaulskPt commented
Hi, I don't know how your experience is with this example but for me the very high brilliance of the r, g and b values for the LED (for my eyes) are way too high. I almost cannot look into the light without getting blinded for a while.
To solve this I added some definitions for the value of brilliance set initially:
I added the following definitions (from line 41):
/* Added by @PaulskPt */
uint8_t brill_red = 0; // Initial brilliance
uint8_t brill_green = 25; // idem
uint8_t brill_blue = 25; // idem
#define brill 30 // inside main loop: max value for brilliance
Then I changed : update_led(0, 255, 200);
into:
ESP_LOGI("Main", "Initial LED brilliance set to: r(%d), g(%d) and b(%d)", brill_red, brill_green, brill_blue);
update_led(brill_red, brill_green, brill_blue);
and inside the loop of app_main():
instead of:
int r = rand() % 256"
int g = rand() % 256;
int b = rand() % 256;
I changed into:
int r = rand() % brill;
int g = rand() % brill;
int b = rand() % brill;
Finally, below the line printing the MAC address, I added the following print line:
ESP_LOGI("Main", "LED brilliance for r(%d), g(%d) and b(%d) maximum: %d", r, g, b, brill);
See the mods in my fork:
https://github.com/PaulskPt/STAMP-C3/blob/master/idf/RGB_LED_Control/main/main.c
PaulskPt commented
Tinyu-Zhao commented
Thanks for your help, I have updated our example.