Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!
Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.
Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!
[Solved] WS2812B Static white color with dimming button
(@Anonymous)
Joined: 1 second ago
Posts: 0
Topic starter
January 17, 2022 6:52 AM
Hi, could someone write a code for me in which the leds are white and can be dimmed with a button? 25% 50% 75% and 100% brightness. Arduino Pro Micro pin 6, 14 leds
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2744
January 17, 2022 7:31 AM
What type of LEDs are you using? RGB Led strip? (WS2811 or WS2812)
What did you try yourself so far?
(@Anonymous)
Joined: 1 second ago
Posts: 0
Topic starter
January 17, 2022 7:33 AM
(@Anonymous)
Joined: 1 second ago
Posts: 0
Topic starter
January 17, 2022 7:35 AM
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2744
January 18, 2022 6:41 AM
To get white we would indeed need to define red, green and blue, for example:
strip.setPixelColor(Pixel, strip.Color(255, 255, 255));
(the errors mention: "red", "green" and "blue" as not defined)
To dim the white color, you can take different values, eg.
strip.setPixelColor(Pixel, strip.Color(100, 100, 100));
Hope this helps! 😊
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2744
January 18, 2022 6:42 AM
p.s. thanks for catching that - I updated the code you linked to as well! 👍