Using the Adafruit Library

The Python code for Adafruit's PWM/Servo breakout on the Pi is available on Github at

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.

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"):
sudo apt-get install git build-essential python-dev
cd ~
git clone
cd Adafruit_Python_PCA9685
sudo python install

Testing the Library

Once the code has be downloaded to an appropriate folder, and you have your PWM/Servo breakout and motor properly connected, you can test it out with the following command (the driver includes a simple demo program): 

cd examples
sudo python
To stop the example, simple press CTRL+C.

Depending on if you are using a standard or continuous rotation servo, you should get results similar to the following (a continuous rotation servo is being used in this particular example):
Last updated on 2016-04-20 at 04.22.04 PM Published on 2012-08-16 at 09.47.27 PM