Use PCA9685 in place of Pimoroni Pan-Tilt HAT Servo Driver

Hi All,

I would like to use the PCA9685 Servo Driver in place of the Pimoroni Pan/Tilt HAT Servo Driver in a project that uses the Pimoroni Pan/Tilt HAT for real time object tracking.

It is my understanding that the Pimoroni Pan/Tilt Servo Driver uses a custom IC to provide the PWM servo control signals and its I2C bus address and control registers are different than those of the PCA9685 Servo Driver.

This Pimoroni Pan/Tilt Face Tracker project uses the PCA9685 Servo Driver .

My question is: Both of these real time tracking projects import the same Pimoroni “pantilthat” library even though one project uses the Pimoroni Pan/Tilt Servo Driver and the other uses the PCA9685 Servo Driver, so how can the same “pantilthat” library import control two different Servo Controllers that have different control registers and I2C addresses?

What am I missing here in understanding the use of the “pantilthat” library import in relation to the particular Servo Driver being used in each project?

Regards,
TCIII

Hi All,

After much IoT research I think that I can answer my own question.

Leigh Johnson’s project that uses the Pimoroni Pan/Tilt HAT loads a “pantilthat” library that is located here.

The Pimoroni Pan/Tilt Face Tracker project that used an Adafruit PCA9685 Servo Driver loaded a “pantilthat” library that is located here. The original Pimoroni project left out a couple of software loading steps that were vital to the project’s operation. RogueM’s instructions in his GitHub ReadMe set things straight.

So I am therefore at the point of seeing if I can use the Adafruit PCA9685 Servo Driver “pantilthat” library in place of the Pimoroni Custom IC Servo Driver “pantilt” library by loading the Adafruit “pantilthat” library by changing the servo control commands in Leigh Johnson’s real time tracking project from the Pimonoi servo control commands to the Adafruit servo control commands. Since I will have RogueM’s "facetracker.py Python code as an example it might not be that difficult, however any assistance to convert Leigh Johnson’s code will be greatly appreciated as I am only a beginner when it comes to coding in Python.

Regards,
TCIII

Hi All,

On second thought, after further review of Leigh Johnson’s GitHub code, it looks like there is no way to determine the PID values for my pan and tilt Hitec servos in relation to the PID values Johnson established for the Pimoroni Pan/Tilt HAT without jumping through a lot of hoops. Therefore I think that I will stick with RogueM’s implementation of the Face Tracker for the Rpi.

Regards,
TCIII