0

For my Python script I'M using this library. I try to set one single, permanent color to all my 60 pixels. As I'm using two LED strips (one strip at GPIO18 and one at GPIO 13), my code handels both of them simultaniously.

The problem is that the code changes the pixel colors one pixel after another and somewhere inbetween the led color changes to white for all the 2 x 60 leds.

So for example: The first 53 LEDs on both strips get the right color and in a split second, all leds are white and stay white.

The weird thing ist that I think it has something to do with the color itself. The color Color(0,0,255) works flawlessly. But my color Color(100,149,237) has this weird behaviour.

def colorBlue(wait_ms=20):
    """Static Color Blue."""
    global strip1
    global strip2

    for i in range(0, strip1.numPixels(), 1):
        strip1.setPixelColor(i, Color(100,149,237))
        strip1.show()
        time.sleep(wait_ms / 500.0)
        strip2.setPixelColor(i, Color(100,149,237))
        strip2.show()
        time.sleep(wait_ms / 500.0)

What do I need to change in my in my code to fix this and keep the color stable?

Daniel
  • 1,179
  • 4
  • 18
  • 31
  • I suspect a wiring issue. Different colors will be set with signals that might be more or less susceptible to wiring conditions. Suggest posting at https://raspberrypi.stackexchange.com instead. – Brick Jun 18 '21 at 12:57
  • I’m voting to close this question because this seems likely to be related to custom wiring rather that just software. Try posting at https://raspberrypi.stackexchange.com instead. – Brick Jun 18 '21 at 12:58
  • "When the 3.3V board tries to talk to the 5V NeoPixel, a variety of strange behaviors can be exibited, including incorrect colors, flickering, dimness, and seemingly "dead" pixels." https://learn.adafruit.com/neopixel-levelshifter – Brick Jun 18 '21 at 14:12
  • @Brick: The board is 5V – Daniel Jun 18 '21 at 14:22
  • Raspberry Pi has 3.3 V GPIO. – Brick Jun 18 '21 at 15:21
  • That is correct, but there are two 5V GPIOs and the LED strips are connected to them, not to the 3,3V. – Daniel Jun 20 '21 at 10:01
  • What model Raspberry Pi has 5 V GPIOs? There are 5 V power pins on the header, but that's different. – Brick Jun 20 '21 at 16:47

0 Answers0