0

Neopixel example issue
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Neopixel example issue

by Keebie81 on Thu Jan 19, 2017 9:45 pm

I am trying to follow the example here https://youtu.be/KoBJG3Taq_Y?t=36m58s but when i try to run it on my Circuit Playground Express i get this error
Code: Select all | TOGGLE FULL SIZE
Traceback (most recent call last):
  File "main.py", line 7, in <module>
  File "neopixel.py", line 10, in __init__
TypeError: Expected a Pin



My code used is
Code: Select all | TOGGLE FULL SIZE
# Main code goes here!
import board
import nativeio
import neopixel


np = neopixel.NeoPixel(nativeio.DigitalInOut(board.NEOPIXEL), 10)
np.fill((255,0,0))
np.write()


The neopixel.py is the same as this one https://github.com/adafruit/Adafruit_Mi ... eopixel.py

Keebie81
 
Posts: 157
Joined: Wed Sep 10, 2014 6:53 pm

Re: Neopixel example issue

by tannewt on Thu Jan 19, 2017 10:16 pm

Its expecting board.NEOPIXEL on its own. Thanks for trying it out!

Code: Select all | TOGGLE FULL SIZE
# Main code goes here!
import board
import nativeio
import neopixel


np = neopixel.NeoPixel(board.NEOPIXEL, 10)
np.fill((255,0,0))
np.write()

tannewt
 
Posts: 2496
Joined: Thu Oct 06, 2016 8:48 pm

Re: Neopixel example issue

by Keebie81 on Thu Jan 19, 2017 10:23 pm

tannewt2 wrote:Its expecting board.NEOPIXEL on its own. Thanks for trying it out!

Code: Select all | TOGGLE FULL SIZE
# Main code goes here!
import board
import nativeio
import neopixel


np = neopixel.NeoPixel(board.NEOPIXEL, 10)
np.fill((255,0,0))
np.write()


That was it, Thanks a ton!

Keebie81
 
Posts: 157
Joined: Wed Sep 10, 2014 6:53 pm

Please be positive and constructive with your questions and comments.