Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Bionic Eye CircuitPython Code
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Bionic Eye CircuitPython Code

by bguenther on Tue Oct 19, 2021 2:50 pm

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

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

Re: Bionic Eye CircuitPython Code

by mikeysklar on Thu Oct 21, 2021 5:32 pm

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.

mikeysklar
 
Posts: 6227
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bionic Eye CircuitPython Code

by bguenther on Thu Oct 21, 2021 6:22 pm

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?

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

Re: Bionic Eye CircuitPython Code

by mikeysklar on Fri Oct 22, 2021 2:09 pm

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?

mikeysklar
 
Posts: 6227
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bionic Eye CircuitPython Code

by bguenther on Fri Oct 22, 2021 4:06 pm

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 160 times

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

Re: Bionic Eye CircuitPython Code

by mikeysklar on Sat Oct 23, 2021 2:22 pm

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.

mikeysklar
 
Posts: 6227
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bionic Eye CircuitPython Code

by bguenther on Sun Oct 24, 2021 1:20 am

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

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

Re: Bionic Eye CircuitPython Code

by mikeysklar on Mon Oct 25, 2021 1:00 pm

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?

mikeysklar
 
Posts: 6227
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bionic Eye CircuitPython Code

by bguenther on Mon Oct 25, 2021 2:35 pm

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:

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

Re: Bionic Eye CircuitPython Code

by mikeysklar on Wed Oct 27, 2021 4:37 pm

@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?

mikeysklar
 
Posts: 6227
Joined: Mon Aug 01, 2016 8:10 pm

Re: Bionic Eye CircuitPython Code

by bguenther on Thu Oct 28, 2021 12:05 pm

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.

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

Re: Bionic Eye CircuitPython Code

by mikeysklar on Thu Oct 28, 2021 1:03 pm

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

mikeysklar
 
Posts: 6227
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.