Hi all,
I am having difficulties with creating smooth movement on a servo motor using a potentiometer and a PCA9685 with an Arduino. My goal is to control a servos position, speed, and upper and lower travel limits, using 4 potentiometers, however I cannot seem to get even one operating correctly. I was using the ServoEasing library as opposed to the standard Adafruit PCA library in an effort to achieve smoother movement, however that has now started creating issues with I2C so I am going to return to using the standard library.
Would anyone be able to provide some example code, using the Adafruit PCA library, for smoothly controlling a servo's position using a potentiometer?
Thank you in advance.
EDIT: I should add that another reason for using the ServoEasing library was the ability to control things like the servo's speed and end-stops with simple commands, as I struggled to find any info on doing this with the Adafruit library. Any help with that aspect would also be greatly appreciated.
Using a Potentiometer and a PCA9685 to control a servo
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- BiggWigg
- Posts: 2
- Joined: Sun Feb 02, 2025 5:43 pm
- adafruit_support_bill
- Posts: 89671
- Joined: Sat Feb 07, 2009 10:11 am
Re: Using a Potentiometer and a PCA9685 to control a servo
What kind of issues? What processor are you using?that has now started creating issues with I2C
The problem with typical hobby-grade RC servos is that you can't actually control the speed. The servo control parameters are embedded in the servo - and most are optimized to go as fast as they can. The only way to slow them down is to break the move down into a lot of smaller moves with a slight delay in between.another reason for using the ServoEasing library was the ability to control things like the servo's speed
For the PCA9685, this means lots of commands on the i2c bus. That is how the ServoEasing library works. And it is unlikely that you would be able to do it any more efficiently using our library.
- BiggWigg
- Posts: 2
- Joined: Sun Feb 02, 2025 5:43 pm
Re: Using a Potentiometer and a PCA9685 to control a servo
Turns out the I2C issue was my code. I am using an Arduino Mega 2560.What kind of issues? What processor are you using?
Any other issues I have now are in relation to the ServoEasing library, not the Adafruit library, so I suppose this could be considered solved.
- adafruit_support_bill
- Posts: 89671
- Joined: Sat Feb 07, 2009 10:11 am
Re: Using a Potentiometer and a PCA9685 to control a servo
Good to hear you solved it. Thanks for the follow-up.
Please be positive and constructive with your questions and comments.