Datasheet
Using the Python Library
The Python code for Adafruit's PWM/Servo breakout on the Pi is available on Github
at https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code (http://adafru.it/aOg)
This code should be a good starting point to understanding how you can access SMBus/I2C
devices with your Pi, and getting things moving with your PWM/Servo breakout.
Before you start, you'll need to have the python smbus library installed, run apt-get install
python-smbus
Downloading the Code from Github
The easiest way to get the code onto your Pi is to hook up an Ethernet cable, and clone it
directly using 'git', which is installed by default on most distros. Simply run the following
commands from an appropriate location (ex. "/home/pi"):
if you get an error when running the git command, try running the installer,
sudo apt-get install git
to install git
Testing the Library
Once the code has be downloaded to an appropriate folder, and you have your PWM/Servo
HAT and motor properly connected, you can test it out with the following command (the
driver includes a simple demo program):
git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git
cd Adafruit-Raspberry-Pi-Python-Code
cd Adafruit_PWM_Servo_Driver
sudo python Servo_Example.py
© Adafruit Industries
https://learn.adafruit.com/adafruit-16-channel-pwm-servo-hat-for-
raspberry-pi
Page 16 of 25