Page 1 of 1
Forum

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!




WS2812B Static whit...
 
Share:
Notifications
Clear all

[Solved] WS2812B Static white color with dimming button


(@karol01eu)
New Member
Joined: 4 months ago
Posts: 3
Topic starter  

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


ReplyQuote
 Hans
(@hans)
Noble Member Admin
Joined: 9 years ago
Posts: 2187
 

What type of LEDs are you using? RGB Led strip? (WS2811 or WS2812)

What did you try yourself so far?


ReplyQuote
(@karol01eu)
New Member
Joined: 4 months ago
Posts: 3
Topic starter  

@hans WS2812b

I tried it but it won't work https://www.tweaking4all.com/forum/arduino/how-to-create-a-static-color-show-using-arduino-for-ws2812b-led-strip/


ReplyQuote
(@karol01eu)
New Member
Joined: 4 months ago
Posts: 3
Topic starter  


ReplyQuote
 Hans
(@hans)
Noble Member Admin
Joined: 9 years ago
Posts: 2187
 

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! 😊 


ReplyQuote


 Hans
(@hans)
Noble Member Admin
Joined: 9 years ago
Posts: 2187
 

p.s. thanks for catching that - I updated the code you linked to as well! 👍 


ReplyQuote

Like what you see and you'd like to help out? 

The best way to help is of course by assisting others with their questions here in the forum, but you can also help us out in other ways:

- Do your shopping at Amazon, it will not cost you anything extra but may generate a small commission for us,
- send a cup of coffee through PayPal ($5, $10, $20, or custom amount),
- become a Patreon,
- donate BitCoin (BTC), or BitCoinCash (BCH).

Share: