1

I was playing with the idea to install some nice LED strips in my home. But, after running the code, the LEDs would keep the last color they were given. So I set the color to RGB(0,0,0) in order to turn them off. My question is: Are they now turned off? Or, are they still using electricity?

And what is the right way to do it?

I'm running the code on my Raspberry Pi and I am using Python.

My code:

import board
import time
import neopixel
 

# Choose an open pin connected to the Data In of the NeoPixel strip.
pixel_pin = board.D18
 
# Choose the number of NeoPixels.
num_pixels = 2
 
# Choose the order of the pixel colors - RGB or GRB.
ORDER = neopixel.RGB 
 
pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.0, auto_write=False, pixel_order=ORDER)

# Show red.
pixels.fill((255,0,0))
pixels.show()

time.sleep(2)

# Turn them off.
pixels.fill((0,0,0))
pixels.show()
Community
  • 1
  • 1

1 Answers1

0

Have you checked your grounds? I have used strips like these before using an Arduino and I had similar issues because of a missing ground connection.

Here is a link specific to the issue you are facing with the hardware you are using. The link discusses a ground issue.

https://forums.adafruit.com/viewtopic.php?f=47&t=81506

eltee
  • 196
  • 1
  • 6
  • They are grounded and when set to RGB(0,0,0) they won't flicker and stay dark. I guess that's the way to do it if I want to turn them off. I was thinking that there would be some kind of code like `pixels.stop()` to turn them off. Thanks for the tip. – Mysterious Challenger Mar 05 '19 at 12:33