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

6 Posts
2 Users
0 Likes
1,657 Views
(@Anonymous)
Joined: 1 second ago
Posts: 0
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)
Famed Member Admin
Joined: 11 years ago
Posts: 2678
 

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

What did you try yourself so far?


   
ReplyQuote
(@Anonymous)
Joined: 1 second ago
Posts: 0
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
(@Anonymous)
Joined: 1 second ago
Posts: 0
Topic starter  


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2678
 

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)
Famed Member Admin
Joined: 11 years ago
Posts: 2678
 

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


   
ReplyQuote
Share: