I am having some issues with wiring or coding this project. To preface I am using the Gemma M0, a 60 NeoPixel LED(Picture attached), and circuitpython for the code. The blinking code provided from the tutorial page on CircuitPython works, but any code referencing the NeoPixels does not work. The way I have it wired to the Gemma M0 is (Gemma M0 --> NeoPixel) GND-->GND, D1-->DIN, Vout --> 5V. I changed my NeoPIxel count in the code to the correct amount connected and it is wired on the correct side or the arrow. I have also tried the Arduino IDE as well with no such luck.
Link to project: https://learn.adafruit.com/larson-scann ... s/overview
code used:
Code: Select all
import time
import board
import neopixel
numpix = 11 # Number of NeoPixels
pixpin = board.D1 # NeoPixels pin. For Gemma M0 = D1, Trinket M0 = D4
strip = neopixel.NeoPixel(pixpin, numpix, brightness=1, auto_write=False)
pos = 0 # position
direction = 1 # direction of "eye"
while True:
strip[pos - 2] = ([16, 0, 0]) # Dark red
strip[pos - 1] = ([128, 0, 0]) # Medium red
strip[pos] = ([255, 48, 0]) # brightest
strip[pos + 1] = ([128, 0, 0]) # Medium red
if (pos + 2) < numpix:
# Dark red, do not exceed number of pixels
strip[pos + 2] = ([16, 0, 0])
strip.write()
time.sleep(0.03)
# Rather than being sneaky and erasing just the tail pixel,
# it's easier to erase it all and draw a new one next time.
for j in range(-2, 2):
strip[pos + j] = (0, 0, 0)
if (pos + 2) < numpix:
strip[pos + 2] = (0, 0, 0)
# Bounce off ends of strip
pos += direction
if pos < 0:
pos = 1
direction = -direction
elif pos >= (numpix - 1):
pos = numpix - 2
direction = -direction