scottlawsonbc / audio-reactive-led-strip

:musical_note: :rainbow: Real-time LED strip music visualization using Python and the ESP8266 or Raspberry Pi
MIT License
2.69k stars 642 forks source link

led strip #206

Closed richyxi closed 5 years ago

richyxi commented 5 years ago

how can i use a ws2811 strip?

gaijinsr commented 5 years ago

Don't use the Neopixel library. You can use the Arduino/ESP code from the SystematicLEDs package, https://github.com/not-matt/Systematic-LEDs/tree/master/arduino/ws2812_controller

The format is slightly different, so (in addition to fixing the UDP port), you need to make sure that audio-reactive-led-strip sends all the pixel's data each time, without an index. Here are my changes to led.py

52,53c68,69 < n_packets = 1 # len(idx) // MAX_PIXELS_PER_PACKET + 1

idx = [i for i in idx if not np.array_equal(p[:, i], _prev_pixels[:, i])]
n_packets = len(idx) // MAX_PIXELS_PER_PACKET + 1

55,57c71 < if (p!=_prev_pixels).any(): # only send if something changed! < for packet_indices in idx:

for packet_indices in idx:

61,62c75 < m += chr(p[0][i]) + chr(p[1][i]) + chr(p[2][i])

            m += chr(i) + chr(p[0][i]) + chr(p[1][i]) + chr(p[2][i])

64c77 < # m.append(i) # Index of pixel to change

            m.append(i)  # Index of pixel to change

Works just fine with my 2811 strips.

Best, Stefan

gaijinsr commented 5 years ago

Sorry about the formatting. The < lines are my code changes, the quoted code blocks are the original lines.

richyxi commented 5 years ago

thks sir:) sorry for being this late i was on busy due school. i just came back to do some experiments with this kind of strips and i faced another issue, the ws2811 works with 12v but the esp with 3.3v. what do you do to feed both devices with the same power source? it would be very helpful men, thank u in advance

joeybab3 commented 5 years ago

What esp module are you using?

richyxi commented 5 years ago

nodemcu V3.0 i think is the esp-12e

El lun., 27 de mayo de 2019 21:30, Joey Babcock notifications@github.com escribió:

What esp module are you using?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/scottlawsonbc/audio-reactive-led-strip/issues/206?email_source=notifications&email_token=ALHKYG7APXZLDMXMK2BE4EDPXSKNBA5CNFSM4HHIBIF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWKZNLQ#issuecomment-496342702, or mute the thread https://github.com/notifications/unsubscribe-auth/ALHKYG3NIHOF3OXJCRNMJC3PXSKNBANCNFSM4HHIBIFQ .

joeybab3 commented 5 years ago

Try using a logic level converter for that if its 12v or are you saying that you want to power the esp using the same supply as the LED strip? If that is the case, just use a converter.