PCA9685 with the propeller?
in Propeller 1
Hey guys, noob here.
Is there any way to use the PCA9685 i2c port expender with the propeller?
https://www.adafruit.com/product/815
Thanks!
Is there any way to use the PCA9685 i2c port expender with the propeller?
https://www.adafruit.com/product/815
Thanks!

Comments
Yes. I2C is used often on the propeller. Several objects in the OBEX.
@anybody
or if possible: Jérôme Decock
I found code on the obex for a PCA9685.
Going to try it soon. No instructions as to supposedly control individual servos.
Any simple ideas?
Thank you in advance.
Martin
@jeromelab
Hello. I have downloaded your code for the PCA9685. Wondering If you are still around and
If you could give me some simple instructions as to get started. I will be using two servos
on this device.
Thank you.
Martin
If you're only needing to control two servos -- and you have cog to spare -- you can easily do that in Spin (or any other P1 language). The CTRx module has two counters which will let your run two servos (without reconfiguring) and you get nice precision with your pulses. I've attached a simple object. it uses the PWM/NCO mode of the counter to create the servo pulses. The code as is lets you set the position in microseconds, but with the resolution of the system counter you could do sub-microsecond (e.g., 0.1) pulses if you like.
Here's quick check of the object output setting servo channel 0 to 1000us and servo channel 1 to 2000us.
If you're set on the PCA9685 you should start with downloading the datasheet. You'll need to learn the register assignments for controlling the PWM frequency and the settings for each pin/channel. I think I found the object you reference; with the datasheet you should be able to suss out how things work, and get confirmation from an AI agent.
Link to my PCA9685 chat: https://chatgpt.com/share/6976dc93-4fd0-8006-97ca-524d29b35fb3