Raspberry Pi with Adafruit 16-Channel PWM/servo HAT coded in Python

Hi, my name is Alex I’m a student at Widener University and I’m trying to make an AUV. I am trying to use VSCode on a Raspberry Pi, coded in Python, with an Adafruit PCA9685 16-channel PWM hat to control the Basic ESCs to run the T200 motors. Everything is set up correctly as far as I know and it is using i2c to communicate. There is 1 14V 9200mAh battery to power 1 motor at the moment. I am unfamiliar with the syntax and code required to get the motors to run could anyone please help with a starting point?

Thanks in advance,
Alex

Hi @kristeller, welcome to the forum! :slight_smile:

Cool! :smiley:

I’d recommend referring to the guides section of our Basic ESC product page, to get an overview of the PWM signals the ESC expects to be sent for initialisation and control, and how it responds to them. This comment may also be relevant.

The ArduPilot PCA9685 library may be worth referring to for some functions you may want to implement and use, but it’s written in C++, and is likely more complicated than is required for your purposes. I expect there is also example code available from Adafruit for at least getting the hat up and running.

1 Like