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!
Ad Blocking Detected
Please consider disabling your ad blocker for our website.
We rely on these ads to be able to run our website.
You can of course support us in other ways (see Support Us).
[Solved] WS2812B Static white color with dimming button
Joined: 1 second ago
Posts: 0
Topic starter
January 17, 2022 5: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: 10 years ago
Posts: 2507
January 17, 2022 6:31 AM
What type of LEDs are you using? RGB Led strip? (WS2811 or WS2812)
What did you try yourself so far?
Joined: 1 second ago
Posts: 0
Topic starter
January 17, 2022 6:33 AM
Joined: 1 second ago
Posts: 0
Topic starter
January 17, 2022 6:35 AM
(@hans)
Famed Member Admin
Joined: 10 years ago
Posts: 2507
January 18, 2022 5: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! 😊
Ad Blocking Detected
Please consider disabling your ad blocker for our website.
We rely on these ads to be able to run our website.
You can of course support us in other ways (see Support Us).
(@hans)
Famed Member Admin
Joined: 10 years ago
Posts: 2507
January 18, 2022 5:42 AM
p.s. thanks for catching that - I updated the code you linked to as well! 👍
Ad Blocking Detected
Please consider disabling your ad blocker for our website.
We rely on these ads to be able to run our website.
You can of course support us in other ways (see Support Us).