Raspberry pi, python and Adafruit16-Channel PWM

I’m new to robotics, not new to Pi and Python.

I started with a simple two wheel robot from Adafruit to teach my daughter code and robotics. She and I built it and now are looking to add an xbox one controller and additional servos.

I have the xbox one wireless controller connected and some test python code that accepts input from joystick and buttons…now trying to figure out how to translate joystick movements to the two wheel differential drive.

Long term - building a puppet mech with 4 wheels on the base, one for torso (left/right) and two for rotating arm cannons. Left joystick controls wheels, right joystick torso, trigger rotates arm cannons. We’ll be adding the 16 Channel PWM mentioned in the subject (Adafruit PID: 2327)

Question - it looks like I can do all this in Python with the Ubiquity Pi distro…but before I frag my current install, would greatly appreciate a quick yes/no on this.

Thanks ahead of time - my daughter’s interest in robotics is eclipsing my (and her school’s) knowledge and any help will be most welcome.


This sounds within the reach of Ubuntu Linux 16.04 or later when it has Python on the distribution. Our image has far more than you have specifically discussed.

Be sure the drivers for running that board are able to run on Ubuntu Linux 16.04 if you want specific details to better guage if it will all work.

When I am faced with the thought of using a new image I save the old SD micro card either physically or by making an image of that full SD card. That way you can revert by re-inserting the old card (assuming you save other files along the way OFF of the card of course.

I run an 8-channel Pololu PWM controller off of a USB to serial converter in the Pi USB jack with the Pololu protocol right now on a robotic arm and I use 6 of the PWM outputs. That was built on top of our Ubiquity Robotics distribution and runs on Python 2.7 (of course sometimes you have to install your custom drivers and so on with PIP or other things but that is to be expected). This is why I feel you will be fine.

This is a delayed question if you see it, great.
Are you saying the total number of PWM outputs you want is 4?

If it’s useful to you, I wrote a PCA9685 ROS driver entirely in C++ which will work with the Adafruit board being mentioned. Python tends to hog a lot of resources for the limited compute on the Raspberry Pi. All you need to do is configure and run the ROS node and you can set PWM values by publishing to a ROS topic.