2

I've connected two rgb strips(WS2812B) to raspberry pi. Each strip consists of 60 LEDs. The first strip data line is connected to GPIO pin number 18 & Second strip data line is connected to GPIO pin number 12. I'm using strandtest.py to control my strip. Initially I've used 12 as my pin number in the code then the second strip glows up. But Now if I use 18 as my pin number in the code then both of the strips starts to glow. How to control single strip at once?

  • How are you powering the strips? – stevieb Feb 25 '19 at 15:11
  • I've connected a common power source to both the strips that is connected to an external power supply – Bharath Pabba Feb 26 '19 at 3:49
1

Now I've connected both the strips in series. This code worked for me:

import board
import neopixel
pixels = neopixel.NeoPixel(board.D18,120)

    for i in range(0,119):
       if i<=59:
          pixels[i] = (0,255,0)
       else:
          pixels[i] = (255,0,0)
    pixels.show()
  • clearly your original code was buggy – Jaromanda X Feb 25 '19 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.