Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5369

Beginners • Wrong Pixels Lighting Up on WS2812B Strip

$
0
0
I have a raspberry pi pico connected to a ws2812b LED light strip (with a logic level converter in the middle), and I've got it set up with my piano keyboard so that when I press a key on the keyboard, the pixels closest to it light up with the pressed color (e.g. yellow in the screenshot below), and will be lit up with an ambient color (e.g. green in the screenshot) when not pressed. I've got it working almost perfect, however I have this problem where every once in a while, the wrong pixels will be lit up with the pressed color when they should be the ambient color. It usually only happens for a fraction of a second and it always happens before (to the left) of where I am actually playing. It also generally follows the same shape that I am playing (e.g. If I am playing three notes in the mid section of the keyboard, it will light up three notes in the lower section of the keyboard with the exact same spacing between each note).

I have NO IDEA what is causing the issue. I am 99% sure that it doesn't have to do with a bug in my code, because I have unit tested every single section of the code and everything checks out. I've even printed out all the data that is being sent from the pi to the LED strip, and there is no indication that those lower pixels should have ever been lit up. So I'm wonder if there is some sort of hardware/wiring problem? I've tested it with two different LED strips and gotten the same result. It happens both with and without a logic level converter.

Another thing to note (if it helps give any clues) is that I have recently added a fade effect, so that when you let go of a key on the piano, it will gradually fade out from the pressed color to the ambient color. Ever since I added that, the problem with the wrong pixels lighting up seems to happen more frequently, which I find interesting. It seems that the more data I send to the LED strip the more this happens.

I am very new to Raspberry Pis and have no electrical engineering experience, so any and all help will be greatly appreciated!
IMG_2343.jpg

Statistics: Posted by devinator9876 — Sun Mar 03, 2024 10:56 pm



Viewing all articles
Browse latest Browse all 5369

Trending Articles