0

My neopixels aren't working when I run them, I am using curcuitpython and using all libraries required

import neopixel
from adafruit_led_animation.animation.solid import Solid
from adafruit_led_animation.color import RED
pixel_pin = board.GP0
pixel_num = 8
pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.2, auto_write=False)

I keep getting this in the console

TypeError: function missing required positional argument #3

The same thing happens when I try normal neopixel code

import time
import board
from rainbowio import colorwheel
import neopixel
# Update this to match the number of NeoPixel LEDs connected to your board.
num_pixels = 8
pixels = neopixel.NeoPixel(board.GP0, num_pixels, auto_write=False)
pixels.brightness = 0.5
def rainbow(speed):
 for j in range(255):
 for i in range(num_pixels):
 pixel_index = (i * 256 // num_pixels) + j
 pixels[i] = colorwheel(pixel_index & 255)
 pixels.show()
 time.sleep(speed)
while True:
 rainbow(0)

I would really appreciate if someone could help. PLEASE

asked Jan 18, 2022 at 16:09
5
  • 3
    Quick guess -- this: neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.2, is missing an argument in between pixel_num and brightness=. Commented Jan 18, 2022 at 16:12
  • Maybe, I only recently joined the python community and have very little experience with it. Commented Jan 18, 2022 at 18:09
  • This is code from the adafruit website and I plan to modify it when it's fixed Commented Jan 18, 2022 at 18:21
  • which version of circuitpython are you running? Commented Jan 18, 2022 at 22:56
  • I am running 7.1.1 Commented Jan 18, 2022 at 22:58

1 Answer 1

0

Just check that you have the neopixel.py file installed in the lib folder of the circuitpy device, not the neopixel.mpy

answered May 4, 2022 at 1:25
2

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.