Error importing neopixel in circuitpython

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
WeihengFu
 
Posts: 2
Joined: Mon Mar 08, 2021 6:40 pm

Error importing neopixel in circuitpython

Post by WeihengFu »

Hi, I have been trying to use a Trinket M0 with a Neopixel. I had no success with arduino IDE so I used circuitpython. I have tried a bunch of examples, the only one that worked for me is this simple one: https://github.com/garyexplains/example ... /blinky.py
I have tried all other examples but no luck, even with the internal dotstar example that supposedly should work: https://github.com/garyexplains/example ... /rgbled.py
Since my main goal was to follow this tutorial: https://learn.adafruit.com/breath-of-th ... ython-code
I tried pasting this code, and it did not work. After experimenting a bit, it seems that the issue happens with import neopixel. The central dotstar flashes red even when my program only has this one import statement. Since the import statement was bugged I could not proceed and debug further.

I am using circuitpython 7.0.0, neopixel.mpy from the 20211221 release.

Any suggestions are greatly appreciated!!!

User avatar
tannewt
 
Posts: 3304
Joined: Thu Oct 06, 2016 8:48 pm

Re: Error importing neopixel in circuitpython

Post by tannewt »

Please connect to the serial output of the board and see what the error is and post it here along with the full code.py.

Instructions on how to do that are here: https://learn.adafruit.com/welcome-to-c ... al-console

User avatar
WeihengFu
 
Posts: 2
Joined: Mon Mar 08, 2021 6:40 pm

Re: Error importing neopixel in circuitpython

Post by WeihengFu »

Unfortunately trinket M0 does not have serial, and the metro I own is not compatible with circuitpython either. I did have success with arduino ide in the end; for those of you that also tried the example code, don't trust the demo too much. In my case the trinket m0 red led is port 13, but demo uses port 1 and that caused the 'error'.

Anyways thank you for your reply! I will definitely try debugging circuitpython once I buy a circuitpython board with serial in the future.

User avatar
tannewt
 
Posts: 3304
Joined: Thu Oct 06, 2016 8:48 pm

Re: Error importing neopixel in circuitpython

Post by tannewt »

CircuitPython does serial over USB by default. Any CircuitPython board with USB will have this.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”