Hi, I'm very new to CircuitPython and am using a Teensy 4.0. I am trying to connect my WS2813 144 led strip for a project I'm doing but I'm having trouble with the neopixel library. I keep getting an error when trying a simple script shown below to light a few pixels.
Code: Select all
import neopixel
import board
pin_number = board.D6
num_pixels = 144
pixels = neopixel.NeoPixel(pin_number, num_pixels, auto_write=False)
pixels[0] = (255, 0, 0)
pixels[9] = (0, 255, 0)
pixels.show()
the error is as follows:
Code: Select all
File "code.py", line 7, in <module>
TypeError: function missing required positional argument #3
looking at the neopixel library on github
here this third missing argument is apparently the bytes per pixel (3 in my case). When I add this argument to the code I am given the following error
Code: Select all
File "code.py", line 7, in <module>
File "adafruit_seesaw/neopixel.py", line 98, in __init__
AttributeError: 'Pin' object has no attribute 'write'
If anyone could give me some advice on how to get this code to work I would very grateful :)
Thanks
Redha