0

CircuitPython libraries needed for POV LED Wand
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CircuitPython libraries needed for POV LED Wand

by martian on Tue Dec 12, 2017 3:47 am

Hi,

I'm trying to see if I can make this project using a trinket MO:

https://learn.adafruit.com/circuitpytho ... w?view=all

The first roadblock is the python libraries. The complete collection is too large to fit in the Trinket M0 storage.

I am hoping if I just install the specific library files needed, I can make it work. But I don't know how to figure it out which are needed.

Anyone have any idea?

Thanks!

martian
 
Posts: 42
Joined: Wed Sep 27, 2017 2:17 am

Re: CircuitPython libraries needed for POV LED Wand

by danhalbert on Tue Dec 12, 2017 10:25 am

I looked at the source code for this particular program, and you don't actually need any extra libraries. All the ones you need should be built in. (We'll see about correcting that in the guide.) If any libraries are needed, you can make a "lib/" folder on the CIRCUITPY drive and just copy over the ones you need. You also need a .bmp image of your choosing to read. Details of the size and format are in the guide.

danhalbert
 
Posts: 619
Joined: Tue Aug 08, 2017 12:37 pm

Re: CircuitPython libraries needed for POV LED Wand

by martian on Tue Dec 12, 2017 4:16 pm

thanks danhalbert!

You seem to be correct. I also had tried this on a Feather M0 express, which could hold the whole library, and it worked. But I just went back and removed the libraries and it STILL works!

However, it still doesn't seem to work on the Trinket M0. It throws the following error in the serial monitor:

File "main.py", line 96, in <module>
File "main.py", line 96, in <module>
NameError: name 'halt' is not defined


Any insight into this would be aprreciated.

Additionally, FYI, I tried the code as is, and also swapped this line

Code: Select all | TOGGLE FULL SIZE
dotstar = busio.SPI(board.SCK, board.MOSI)

for this

Code: Select all | TOGGLE FULL SIZE
dotstar = busio.SPI(board.D3, board.D4)


I'd wondered if somehow the SPI pins were not being pulled in correctly, so tried naming them expicitily. No luck, unfortunately.

martian
 
Posts: 42
Joined: Wed Sep 27, 2017 2:17 am

Re: CircuitPython libraries needed for POV LED Wand

by danhalbert on Tue Dec 12, 2017 4:26 pm

The error handling code is a little broken, but that error happens when it can't find the file you specified in FILENAME (E.g., blinka.bmp). Did you copy that file onto CIRCUITPY?

board.SCK and board.MOSI are defined on the Trinket M0 as D3 and D4, so you don't need to change the pin names.

danhalbert
 
Posts: 619
Joined: Tue Aug 08, 2017 12:37 pm

Re: CircuitPython libraries needed for POV LED Wand

by martian on Tue Dec 12, 2017 9:16 pm

That did it!!! thanks. Ugh, I can't believe I forgot to copy that file. I'd run out of space trying to add libraries and forgotten to go back to that.

martian
 
Posts: 42
Joined: Wed Sep 27, 2017 2:17 am

Please be positive and constructive with your questions and comments.