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
WellActually...WellActually...
asked Jan 18, 2022 at 16:09
1 Answer 1
Just check that you have the neopixel.py file installed in the lib folder of the circuitpy device, not the neopixel.mpy
-
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.2022年05月04日 06:45:30 +00:00Commented May 4, 2022 at 6:45
-
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewMilliways– Milliways2022年05月04日 23:44:21 +00:00Commented May 4, 2022 at 23:44
neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.2,
is missing an argument in betweenpixel_num
andbrightness=
.