Bionic Eye CircuitPython Code

Wearable electronics: boards, conductive materials, and projects from Adafruit!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
bguenther
 
Posts: 10
Joined: Sun Dec 28, 2014 7:01 pm

Bionic Eye CircuitPython Code

Post by bguenther »

Hello -

I'm following the instructions for the Bionic Eye project and am a little confused when I get to the CircuitPython Code page:

https://learn.adafruit.com/3d-printed-b ... ython-code

Where I am lost is the instructions in the code say, "Required library is the Adafruit_SoftServo library available at https://github.com/adafruit/Adafruit_SoftServo" and there is code at the bottom of the page that I'm not sure what to do with:

$ mkdir /Volumes/CIRCUITPY/lib
$ cp -pr adafruit_motor /Volumes/CIRCUITPY/lib

Do I add the Adafruit_SoftServo library to my CIRCUITPY drive? It seems like an IDE code. What do I do with that bit of code at the bottom of the page?

Thanks for your help

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bionic Eye CircuitPython Code

Post by mikeysklar »

I think I already replied to this one. The Adafruit_SoftServo library is Arduino only and not at all applicable. You have followed the instructions correctly if you pasted the example code into code.py and copied the entire adadfruit_motor folder into the /Volumes/CIRCUITPY/lib folder.

User avatar
bguenther
 
Posts: 10
Joined: Sun Dec 28, 2014 7:01 pm

Re: Bionic Eye CircuitPython Code

Post by bguenther »

Yes, thank you! Sorry for the re-post.

I've uploaded everything correctly, but the project still isn't working. I suspect that it might be the battery pack since nothing is lighting up when it is unplugged from the computer, but shouldn't it work when connected via USB?

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bionic Eye CircuitPython Code

Post by mikeysklar »

Let's get into the specifics of your setup.

Are you using a Trinket M0?

When you plug it into your computer do you see the drive mounted? What files are listed?

User avatar
bguenther
 
Posts: 10
Joined: Sun Dec 28, 2014 7:01 pm

Re: Bionic Eye CircuitPython Code

Post by bguenther »

Yes, I have a Trinket M0 and the CIRCUITPY drive pops up when I plug it in. I was able to get the Blink sketch to run fine on it. I'm providing a screenshot of the files listed.

I'm not sure if these means anything, but the Trinket lights up when I move the servo arms by hand.

Thanks again for your help with this.
Attachments
Image 10-22-21 at 1.02 PM.jpg
Image 10-22-21 at 1.02 PM.jpg (68.59 KiB) Viewed 513 times

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bionic Eye CircuitPython Code

Post by mikeysklar »

Thank you for the CIRCUITPY screenshot. This look good and I'm glad you got the Trinket successfully running blink.

Let's make sure your bootloader, CircuitPython and libraries are up to date.

You can double tap reset and check out the TRINKETBOOT drive (or something *BOOT). There will be a file INFO_UF2.txt which has the bootloader version you are on. It should be v3.13.0.

Make sure you are running CP 7.x with the current version 7.x bundle for adafruit_motor.

https://circuitpython.org/board/trinket_m0/
https://circuitpython.org/libraries

After we confirm you are current we can get back into making the steppers go.

User avatar
bguenther
 
Posts: 10
Joined: Sun Dec 28, 2014 7:01 pm

Re: Bionic Eye CircuitPython Code

Post by bguenther »

Okay! My boot loader was out of date and is now updated. I also installed the latest adafruit_motor files.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bionic Eye CircuitPython Code

Post by mikeysklar »

Alright. Congrats on the bootloader and library files.

Can you also confirm that you are running CircuitPython 7?

Are you still seeing errors? If so what is on the REPL console?

User avatar
bguenther
 
Posts: 10
Joined: Sun Dec 28, 2014 7:01 pm

Re: Bionic Eye CircuitPython Code

Post by bguenther »

I am running Circuit Python 7.

When I save the code, the console says:

Code stopped by auto-reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bionic Eye CircuitPython Code

Post by mikeysklar »

@bguenther,

This all sounds good. The console seems to be showing when you save the code that is reloading the controller with it and the code is running without error.

Can you paste in the code you are running and a photo of your wiring? It does not seem like you have a software issue, but maybe a connectivity problem?

User avatar
bguenther
 
Posts: 10
Joined: Sun Dec 28, 2014 7:01 pm

Re: Bionic Eye CircuitPython Code

Post by bguenther »

Since we pretty much ruled out software being a problem, I swapped out the battery pack with another I knew worked and that did the trick. The Trinket lit up and the servos started moving. Thanks again for your help walking me through all this.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bionic Eye CircuitPython Code

Post by mikeysklar »

Good working figuring out that this was a power issue. Congrats.

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

Return to “Wearables”