You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm pretty new to Raspberry Pi, but I've been trying out these through-hole LED neopixels, and I've been getting some strange results. I'm working on a breadboard, and have my power rail hooked up to pin 2 (5V output), ground rail hooked up to pin 6 (ground), and the input on the first LED hooked up to pin 12 (GPIO18). (I'm using this diagram as a reference)
I've written a test script to see if I can get the lights to do what I expect, and haven't had any luck with either SK6812_STRIP or SK6812W_STRIP as the LED_STRIP. Here it is, with the behavior I expect in the print statements, and the behavior that I'm getting in the comments:
importtimefromneopixelimport*# LED strip configuration:LED_COUNT=5# Number of LED pixels.LED_PIN=18# GPIO pin connected to the pixels (18 uses PWM!).#LED_PIN = 10 # GPIO pin connected to the pixels (10 uses SPI /dev/spidev0.0).LED_FREQ_HZ=800000# LED signal frequency in hertz (usually 800khz)LED_DMA=10# DMA channel to use for generating signal (try 10)LED_BRIGHTNESS=255# Set to 0 for darkest and 255 for brightestLED_INVERT=False# True to invert the signal (when using NPN transistor level shift)LED_CHANNEL=0# set to '1' for GPIOs 13, 19, 41, 45 or 53+LED_STRIP=ws.SK6812_STRIPstrip=Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL, LED_STRIP)
rLED=Color(255,0,0)
bLED=Color(0,255,0)
gLED=Color(0,0,255)
defallOne(strip, color):
foriinrange(strip.numPixels()):
strip.setPixelColor(i,color)
strip.show()
return0strip.begin()
strip.setPixelColor(0,rLED)
strip.show()
print("RED LED 0")
# SK6812_STRIP, SK6812W_STRIP: LED 1 is red, LED 0 is offtime.sleep(5)
strip.setPixelColor(0,bLED)
strip.show()
print("BLUE LED 0")
# SK6812_STRIP: LED 0 is bluetime.sleep(5)
strip.setPixelColor(0,gLED)
strip.show()
print("GREEN LED 0")
# SK6812_STRIP: LED 1 is green, LED 0 is offtime.sleep(5)
allOne(strip,rLED)
print("RED LIGHTS")
# SK6812_STRIP: all red, but LED 0 off# SK6812W_STRIP: 0:off 1:red 2:green 3:blue 4:offtime.sleep(5)
allOne(strip,bLED)
print("BLUE LIGHTS")
# SK6812_STRIP: all blue# SK6812W_STRIP: 0:blue 1:off 2:red 3:green 4:bluetime.sleep(5)
allOne(strip,gLED)
print("GREEN LIGHTS")
# SK6812_STRIP: all green, but LED 0 off# SK6812W_STRIP: 0:off 1:green 2:blue 3:off 4:red
(edited this code when I realized I wasn't including the LED_STRIP parameter when creating my strip object, oops)
I seem to be experiencing some slightly different behavior from what's mentioned in issue #198, but that was the most similar issue that I could find. I have a blacklist file at /etc/modprobe.d/snd-blacklist.conf that just contains blacklist snd_bcm2835, and I also have both of the following lines in my /boot/config.txt file:
hdmi_force_hotplug=1
hdmi_force_edid_audio=1
I'd appreciate any suggestions! I've been trying different LED_STRIP settings to no avail, but if I find one that works I'll post back here.
The text was updated successfully, but these errors were encountered:
Ah, that seems to have done the trick! I didn't have a pile of diodes yet, so I got one. I'm getting a bit of flickering on the rainbow effects in strandtest.py, but I think I'll be able to tweak that somehow. I also got a level shifting chip from adafruit that I haven't tried yet, but which should also help. Thanks!
I'm pretty new to Raspberry Pi, but I've been trying out these through-hole LED neopixels, and I've been getting some strange results. I'm working on a breadboard, and have my power rail hooked up to pin 2 (5V output), ground rail hooked up to pin 6 (ground), and the input on the first LED hooked up to pin 12 (GPIO18). (I'm using this diagram as a reference)
I've written a test script to see if I can get the lights to do what I expect, and haven't had any luck with either SK6812_STRIP or SK6812W_STRIP as the LED_STRIP. Here it is, with the behavior I expect in the print statements, and the behavior that I'm getting in the comments:
(edited this code when I realized I wasn't including the LED_STRIP parameter when creating my strip object, oops)
I seem to be experiencing some slightly different behavior from what's mentioned in issue #198, but that was the most similar issue that I could find. I have a blacklist file at
/etc/modprobe.d/snd-blacklist.conf
that just containsblacklist snd_bcm2835
, and I also have both of the following lines in my/boot/config.txt
file:I'd appreciate any suggestions! I've been trying different LED_STRIP settings to no avail, but if I find one that works I'll post back here.
The text was updated successfully, but these errors were encountered: