Go Down

Topic: Button and addressable led (Read 91 times) previous topic - next topic

castel

Hi everybody,

I'm stuck for a few days. That's why I am here for some help.


I own a addressable led: WS2812B 5M.
What I want to do: When I push a button, a LED randomy lights up. When I push the button again, another LED randomly lights up.

The setup with the button is OK but unfortunately, I'm not able to get a LED light up randomly.

I'm using the fastled library.

Anyone having any suggestions?




Thank you in advance,



Castel

sdturner

Post your code. No way to tell without knowing more.

Grumpy_Mike

Quote
The setup with the button is OK but unfortunately, I'm not able to get a LED light up randomly.
When you post your code using the code tags produced by the </> icon. Please say what the code actually does as well as what you would like it to do.

Without seeing your code we can only guess. My guess is that line 24 is wrong, but it is only a guess. Other guesses would be lines 12, 16 and 45.

vinceherman

I disagree with Mike.  it is not the code at all.  You can clearly tell from the missing circuit diagram that the ground is not connected.  :-D

jurs

#4
May 20, 2017, 05:35 pm Last Edit: May 20, 2017, 05:37 pm by jurs
Hi everybody,

I'm stuck for a few days. That's why I am here for some help.


I own a addressable led: WS2812B 5M.
What I want to do: When I push a button, a LED randomy lights up. When I push the button again, another LED randomly lights up.

The setup with the button is OK but unfortunately, I'm not able to get a LED light up randomly.

I'm using the fastled library.

Anyone having any suggestions?

You mean EXACTLY one LED has to light up in a random color?



This means:
- when the button is pressed
- set ALL LEDS to OFF
- then eelect one LED and one color randomly and show

Do you have a test code ready which can light up one LED for a hardware  function test?

Go Up