Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

HATs and other add-ons • Neopixels giving strange results

$
0
0
Hi,

I am using a Pi Zero W and have wired a Neopixel strip to it (https://thepihut.com/products/flexible- ... -led-metre).

Image

I have followed the tutorial from Adafruit both for wiring and for code, but this is the result.

Code:

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries# SPDX-License-Identifier: MIT# Simple test for NeoPixels on Raspberry Piimport timeimport boardimport neopixel# Choose an open pin connected to the Data In of the NeoPixel strip, i.e. board.D18# NeoPixels must be connected to D10, D12, D18 or D21 to work.#pixel_pin = board.D18pixel_pin = board.D12# The number of NeoPixelsnum_pixels = 10# The order of the pixel colors - RGB or GRB. Some NeoPixels have red and green reversed!# For RGBW NeoPixels, simply change the ORDER to RGBW or GRBW.ORDER = neopixel.RGBWpixels = neopixel.NeoPixel(    pixel_pin, num_pixels,  pixel_order=ORDER)while True:    # Comment this line out if you have RGBW/GRBW NeoPixels#pixels.fill((255, 0, 0))    # Uncomment this line if you have RGBW/GRBW NeoPixels        pixels.fill((255, 0, 0, 0))        pixels.show()        time.sleep(1)
Image


Some LED's light, but not in the colour specified. Also only a few light up when I have tried doing, 1, 10 and all. The result is always the same.

Has anyone else come across this and know how to fix it?
Thanks

Statistics: Posted by stephenwatson2010 — Sun Apr 06, 2025 12:45 pm



Viewing all articles
Browse latest Browse all 8041

Trending Articles