Thanks Kevin, very interesting. Your recent Pico 2 live streams got me interested in this. "Solder" comes from the French souder iirc and the L was added because it's rude in British English, as you said. American English doesn't have that word, so there's no concern. In Canada they pronounce the L.
I know this probably an old question but could you explain why, when I try to install the zip file onto a pico connected to a RPi4 I consistently get a long error message. I have no problem with other zip files. It appears to run someway through the process and then crashes.
hi what uf2 file are running your programme in as i no unstruc or no pca9685 not found what do i need to install first please kevin as servo isn't running
I've got my PCA9685 board set up as per tutorial, but running the i2c.scan() function just returns "[ ]". Does anyone have any suggestions? I've triple checked the wiring
Can anyone tell me why I couldn't install adafruit-circuitpython-servokit on my raspberry pi zero? I have installed Python 3.9.2 and I2C is enabled. The issue tells 'could not fin a version that satisfies the requirement'. I'm stuck, can someone help me? TY.
Thank a lot for the work. Working now on a ESP32 and "Archive" folder in PicoCat repo files version Enought to start. I'm new on micropython. SDA & SCL are 21 & 22 in this microcontroller. I will try on a RPI Pico too.
Hello! I have a question - I build my own project with robo-hand and i used your code, because it perfectly work with servos on RPI Pico. But I have a trouble and watch again this video. I saw that angle of servo working with pca9685 on 180 not right 180, its some of 165-170. Why it happens? In my project I need true 180 angle and 0 angle. Thank you for answer.
It’s to do with a couple of things - the servo may have a wider range -10 to 190 for example so sending a pulse width that works for one doesn’t work for this one. More expensive servos are more accurate but all of them always need calibration.
@@Pony_Slaystation think of it this way - you tell the pca9685 board to make servo one go to 90, but if the servo isn’t that accurate it will go to something approximating that. You csn manually tweak it by measuring the angle and changing the pulse width for that specific servo. I’d use a map function to correct this
Hi Kevin your got into great detail. How do I load the code on my pi pico do I use thonny and I don't know how use cat ? I'm. Using pca9685 servo board . What uf2 do I use ?please as like build a skull moving with a pan and tilt and one servo to move the jaw . I Anyone any help please
Hi kevin your video is awsome ,im new to micropython and programing, im having trouble selecting each servo individually on the pca 9685 and how to get them to move separetly .. when i plug the servo index 0 and the 15 the two servos does the same thing even when i tell them to do different degrees... do you have any ideas or tuto to help me figure it out ? Thx for your time.
My board when I scan shows [65, 112] I'm having trouble figuring out what the 65 needs to be converted to in HEX = 0x41 maybe? Then where do you put that info to make it talk to the PCA9685? Thanks
The servo Library creates a PCA9685 object for you... In Kevin's code: "servo = Servos(i2c=i2c)" you just need to override the "address" parameter, so try "servo = Servos(i2c=i2c, address = 0x41)". Should work fine!! This is great if you need to daisy-chain PCA9685 boards together - you can have one "servo" object per board...
Thanks for sharing the info @Cyber_One - Here is a link the Ben Eaters 8bit breadboard computer playlist - ua-cam.com/play/PLowKtXNTBypGqImE405J2565dvjafglHU.html
I did not know that - I knew you could use if to control LEDs (albeit it with a much quicker frequency of 1000hz), but not that it was originally intended for LED lighting control
Thank you very much, I've been following your videos for a while I resume my project and I have a question. How do I reset the positions on the PCA? apparently they are saved and start simultaneously try servo.release(index) but the position is maintained It would be a great help sorry for my english, i speak spanish
Can I use two of these boards and connect them to Pico W to use more than 16 servos? I need to use 18 servos for a hexapod project and I can't find a solution for that
Have you checked out the Pimoroni Servo 2040? It has 18 Servo headers and is based on the RP2040? If you get one, don't forget to add 'kevin' as the coupon code and I'll thank you later
@@kevinmcaleer28 so im currently checking out what the board can do and I cant find anything about any type of remote controll whether it would be radio controll, wifi or bluetooth. I was wondering if you could tell me if there's a way to remotely controll it
Hi! I'm trying to follow this but when I try to do the step at 37:40, I get this: >>> pca = PCA9685(i2c=i2c) Traceback (most recent call last): File "", line 1, in NameError: name 'PCA9685' isn't defined Do you know why this could be? I´ve clicked on both pca9685.py and servo.py and then the upload button att the bottom to upload them to the pico I also get this when trying to import servo: >>> from servo import Servos Traceback (most recent call last): File "", line 1, in File "servo.py", line 7, in ImportError: no module named 'transition' Is it so that I've missed something in the setup or haven't uploaded the files/project correctly?
Try upload ing one file at a time - I don't think you can select both to upload. To check what files are on the pico you can list the files using: import os print(os.listdir()) You should then be able to see the files on the board.
@@kevinmcaleer28 I've tried that now and I tried uploading the project by right-clicking and press "upload project" and still get errors. Here is the terminal printout: >>> Uploading project (main folder)... Not safe booting, disabled in settings Uploading to / ... Reading file status Creating dir Archive [1/27] Writing file 'Archive/_pca9685.py' (2 kB) .... [27/27] Writing file 'vl53l0x.py' (22 kB) Upload done, resetting board... OK >>> import os >>> print(os.listdir()) ['Archive', 'OpenCat.py', 'code.py', 'machine.py', 'pca9685.py', 'picocat.py', 'project.pico-go', 'servo.py', 'test_suite.py', 'trans_test.py', 'transition.py', 'utils.py', 'vl53l0x.py'] >>> from machine import I2C, Pin, PWM >>> sda = Pin(0) >>> scl = Pin(1) >>> id = 0 >>> i2c = I2C(id = id, sda = sda, scl = scl) >>> i2c.scan() [64, 112] >>> pca = PCA9685(i2c = i2c) Traceback (most recent call last): File "", line 1, in NameError: name 'PCA9685' isn't defined >>> I'm on a Mac just like you, I've downloaded VSCode, added the extensions CMake-tools and Pico-Go. I haven't changed anything else. Is there something else I have to set up maybe to make it work?
@@PontusThePilot when you run the code - how are you running it? Using the run command at the bottom of the screen or the green play button at the top of the screen?
@@kevinmcaleer28 I've tried via the terminal following the steps you do in the video, I've tried the run button at the bottom and also right click "Pico-Go -> Run current file" I also tried running the same files in Thonny but still got the same error. There must be something I do wrong with the pca.py file because "from servo import Servos" and "from pca9685 import PCA9685" doesn't give me any errors. I'm kinda clueless of what isn't right since I tried troubleshooting all possible mistakes I could have done. It's not my first time coding in Python but It's my first time using a pi pico and micro Python
Hi Steven, if you're working from the Git repository, you can right-click on the pca9685.py file and upload it to the pico, and it should work fine (Thonny makes this easy). I've updated the description for the show, and if you scroll down, you'll find a link to the code there.
@@tannar4607 Have you copied the pca9865.py file from the github repository that's in the video description - you'll need to copy that the pico for it to work
WORKING AGAIN!!! PCA9685 not working...it may be a bad product and not code. I had recently ordered two new PCA9685's from Amazon and put my 'old' PCA9685 way in a junk drawer. Why? because I had 'new' ones!! Then....disaster struck as both were bad out of the box. I've switched back to my 'old' one from the junk drawer and VIOLA Kevin's code works like magic! Not sure if there's a library or hardware issue but one of my two PCA9685 worked on my Arduino UNO perfectly fine the other was NRFI (not ready for issue) out of the box Maybe purchasing a high quality PCA9685 could do the trick?
thanks for taking time to write the MicroPython code for PCA9685. I didn't want to go down the circuit python route so this is just what I needed ✌
Thanks Kevin, very interesting. Your recent Pico 2 live streams got me interested in this.
"Solder" comes from the French souder iirc and the L was added because it's rude in British English, as you said. American English doesn't have that word, so there's no concern. In Canada they pronounce the L.
I used 4 of those in my InMoov build.
It does work, I used a Raspberry Pi 3 at the time.
I'm remaking Fred and have 2 in so far :-)
Awesome! I’m glad you’ve tried that and it works for InMoov, that validates the idea I have for it too
Thanks for the amazing video. I grabbed your code and it worked the first time!!
I know this probably an old question but could you explain why, when I try to install the zip file onto a pico connected to a RPi4 I consistently get a long error message. I have no problem with other zip files. It appears to run someway through the process and then crashes.
Right on Kevin! nice work
Thanks!
hi what uf2 file are running your programme in as i no unstruc or no pca9685 not found what do i need to install first please kevin as servo isn't running
I've got my PCA9685 board set up as per tutorial, but running the i2c.scan() function just returns "[ ]". Does anyone have any suggestions? I've triple checked the wiring
Can anyone tell me why I couldn't install adafruit-circuitpython-servokit on my raspberry pi zero?
I have installed Python 3.9.2 and I2C is enabled. The issue tells 'could not fin a version that satisfies the requirement'.
I'm stuck, can someone help me? TY.
Thank a lot for the work.
Working now on a ESP32 and "Archive" folder in PicoCat repo files version
Enought to start. I'm new on micropython.
SDA & SCL are 21 & 22 in this microcontroller.
I will try on a RPI Pico too.
se puede poner el programa a un esp32?
Hi kevin,I got a error can you help me .this - importerror: no module named 'adafruit_servokit'
とても参考になります。
ありがとうございます。
ありがとうございました (Thank you)
Hello! I have a question - I build my own project with robo-hand and i used your code, because it perfectly work with servos on RPI Pico. But I have a trouble and watch again this video. I saw that angle of servo working with pca9685 on 180 not right 180, its some of 165-170. Why it happens? In my project I need true 180 angle and 0 angle. Thank you for answer.
It’s to do with a couple of things - the servo may have a wider range -10 to 190 for example so sending a pulse width that works for one doesn’t work for this one. More expensive servos are more accurate but all of them always need calibration.
@@kevinmcaleer28 And how can i fix this problem? I thought that because PWM troubles in PCA controller - isn`t it right?
@@Pony_Slaystation think of it this way - you tell the pca9685 board to make servo one go to 90, but if the servo isn’t that accurate it will go to something approximating that. You csn manually tweak it by measuring the angle and changing the pulse width for that specific servo. I’d use a map function to correct this
@@kevinmcaleer28 Oh, okay! Thank you very much!)
Hi Kevin your got into great detail. How do I load the code on my pi pico do I use thonny and I don't know how use cat ? I'm. Using pca9685 servo board . What uf2 do I use ?please as like build a skull moving with a pan and tilt and one servo to move the jaw . I
Anyone any help please
Hi kevin your video is awsome ,im new to micropython and programing, im having trouble selecting each servo individually on the pca 9685 and how to get them to move separetly .. when i plug the servo index 0 and the 15 the two servos does the same thing even when i tell them to do different degrees... do you have any ideas or tuto to help me figure it out ? Thx for your time.
My board when I scan shows [65, 112]
I'm having trouble figuring out what the 65 needs to be converted to in HEX = 0x41 maybe? Then where do you put that info to make it talk to the PCA9685?
Thanks
Hi - when you create a PCA9685 object, you can pass the address parameter e.g. pca = PCA9685(i2c=i2c, address=0x41)
Hope this helps.
The servo Library creates a PCA9685 object for you... In Kevin's code: "servo = Servos(i2c=i2c)" you just need to override the "address" parameter, so try "servo = Servos(i2c=i2c, address = 0x41)". Should work fine!! This is great if you need to daisy-chain PCA9685 boards together - you can have one "servo" object per board...
The guy who built the computer on bread boards was Ben Eater.
His latest is adding a PS2 keyboard to his computer :-)
Thanks for sharing the info @Cyber_One - Here is a link the Ben Eaters 8bit breadboard computer playlist - ua-cam.com/play/PLowKtXNTBypGqImE405J2565dvjafglHU.html
Can it works with a program made with C? How would it be?
Did you know the PCA9685 was originally created to control LED lighting?
Turns out it also works well for driving servos :-)
I did not know that - I knew you could use if to control LEDs (albeit it with a much quicker frequency of 1000hz), but not that it was originally intended for LED lighting control
Thank you very much, I've been following your videos for a while
I resume my project and I have a question.
How do I reset the positions on the PCA?
apparently they are saved and start simultaneously
try servo.release(index) but the position is maintained
It would be a great help
sorry for my english, i speak spanish
To reset the positions you will need to set them in code
@@kevinmcaleer28 I mean to erase the memory of the PCA
so that when turning on the PCA, the written positions are not started :(
Gracias
@@George24577 pca has no memory. You should initialise the servo positions in your code
Can I use two of these boards and connect them to Pico W to use more than 16 servos? I need to use 18 servos for a hexapod project and I can't find a solution for that
Have you checked out the Pimoroni Servo 2040? It has 18 Servo headers and is based on the RP2040? If you get one, don't forget to add 'kevin' as the coupon code and I'll thank you later
@@kevinmcaleer28 that actually looks great! I'll read a bit more into that and probably buy it, thanks a lot
@@kevinmcaleer28 so im currently checking out what the board can do and I cant find anything about any type of remote controll whether it would be radio controll, wifi or bluetooth. I was wondering if you could tell me if there's a way to remotely controll it
I'm getting no pca ?
Hi!
I'm trying to follow this but when I try to do the step at 37:40, I get this:
>>> pca = PCA9685(i2c=i2c)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'PCA9685' isn't defined
Do you know why this could be?
I´ve clicked on both pca9685.py and servo.py and then the upload button att the bottom to upload them to the pico
I also get this when trying to import servo:
>>> from servo import Servos
Traceback (most recent call last):
File "", line 1, in
File "servo.py", line 7, in
ImportError: no module named 'transition'
Is it so that I've missed something in the setup or haven't uploaded the files/project correctly?
Try upload ing one file at a time - I don't think you can select both to upload. To check what files are on the pico you can
list the files using:
import os
print(os.listdir())
You should then be able to see the files on the board.
@@kevinmcaleer28 I've tried that now and I tried uploading the project by right-clicking and press "upload project" and still get errors.
Here is the terminal printout:
>>>
Uploading project (main folder)...
Not safe booting, disabled in settings
Uploading to / ...
Reading file status
Creating dir Archive
[1/27] Writing file 'Archive/_pca9685.py' (2 kB)
....
[27/27] Writing file 'vl53l0x.py' (22 kB)
Upload done, resetting board...
OK
>>> import os
>>> print(os.listdir())
['Archive', 'OpenCat.py', 'code.py', 'machine.py', 'pca9685.py', 'picocat.py', 'project.pico-go', 'servo.py', 'test_suite.py', 'trans_test.py', 'transition.py', 'utils.py', 'vl53l0x.py']
>>> from machine import I2C, Pin, PWM
>>> sda = Pin(0)
>>> scl = Pin(1)
>>> id = 0
>>> i2c = I2C(id = id, sda = sda, scl = scl)
>>> i2c.scan()
[64, 112]
>>> pca = PCA9685(i2c = i2c)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'PCA9685' isn't defined
>>>
I'm on a Mac just like you, I've downloaded VSCode, added the extensions CMake-tools and Pico-Go.
I haven't changed anything else.
Is there something else I have to set up maybe to make it work?
or am I using a newer version of your git repository where you changed stuff since this video and that's why I can't follow step by step?
@@PontusThePilot when you run the code - how are you running it? Using the run command at the bottom of the screen or the green play button at the top of the screen?
@@kevinmcaleer28 I've tried via the terminal following the steps you do in the video, I've tried the run button at the bottom and also right click "Pico-Go -> Run current file"
I also tried running the same files in Thonny but still got the same error. There must be something I do wrong with the pca.py file because "from servo import Servos" and "from pca9685 import PCA9685" doesn't give me any errors.
I'm kinda clueless of what isn't right since I tried troubleshooting all possible mistakes I could have done.
It's not my first time coding in Python but It's my first time using a pi pico and micro Python
How do I get it to stay in a position after a sequence?
The servos will hold their position - if they are strong enough.
Can we control normal 6v dc motor with it as well?
Probably best with a slightly different board that is designed for that, but yes you could
@@kevinmcaleer28 I need to control 2 dc motor and 2 servo. Can you suggest a better motor driver?
Anybody got a quick solution to the problem of Thonny returns error that "pca not recognized". Is there a micropip install package available?
Hi Steven, if you're working from the Git repository, you can right-click on the pca9685.py file and upload it to the pico, and it should work fine (Thonny makes this easy). I've updated the description for the show, and if you scroll down, you'll find a link to the code there.
Got it - I though it might be a naming convention. appreciate the help and my little spiderbot is at least standing on it's little legs now :)
Not working for me. i get no module named pca, or no module namedpca9685
@@tannar4607 Have you copied the pca9865.py file from the github repository that's in the video description - you'll need to copy that the pico for it to work
@@kevinmcaleer28 yes I did. Still doesn’t work.
Has anyone said when more Pico's will be in stock at the resellers? Last I heard was late Feb, but that has come and gone.
Hi Edward - I’ve ordered a couple more Pico’s no issue, which region are you in -I’ll help you look
Have you ganged any PCA9685 boards together for more devices?
Not tried that yet, should be pretty straight forward if you have one working
WORKING AGAIN!!! PCA9685 not working...it may be a bad product and not code.
I had recently ordered two new PCA9685's from Amazon and put my 'old' PCA9685 way in a junk drawer. Why? because I had 'new' ones!! Then....disaster struck as both were bad out of the box. I've switched back to my 'old' one from the junk drawer and VIOLA Kevin's code works like magic!
Not sure if there's a library or hardware issue but one of my two PCA9685 worked on my Arduino UNO perfectly fine the other was NRFI (not ready for issue) out of the box
Maybe purchasing a high quality PCA9685 could do the trick?
I’ve got the same problem but tried it with a fresh PCA board and still the no module pca message happens. The board shows up on a scan. Any ideas?
Just realised that all the progs should say 'from pca9685' not 'from pca …'
No error message returned. I’ll let you know if it doesn’t work now.