Pololu Python Library

Pololu Micro Serial Servo Controller
Pololu Micro Serial Servo Controller

I started writing a library for controlling the Pololu motor controllers with a computer trough a serial port.

I’m writing this in Python so the code can be cross-platform but I would be very glad to have some feedback about running it on other OSs than Linux. Actually, any feedback would be very welcome.

As of now it can interface with the Pololu Micro Serial Servo Controller that I got form RobotShop.  I am planning to use this code in my upcoming project RobotShop is sponsoring. I will supplement this library as I get newer hardware to work with.

I know there is already a python interface for it but I really wanted to have an object oriented way of managing motors (i.e. they can be instantiated and controlled more easily).

You can download the library here: lib_pololu.py (you will need to change the extension of the file to .py instead of txt).

In order to properly use this library you will require:

  1. Python
  2. Pyserial

If you use a civilized OS you may be able to get all this by typing this in a command prompt:

sudo apt-get install idle python-serial

Here is a sample script that will use the library in order to control a servo: servo_example.py (you will need to change the extension of the file to .py instead of txt).

Note for Redmond OS (aka Window$) users: you will need the Win32 Python extension for pyserial to work.

3 thoughts on “Pololu Python Library

Leave a Comment

Your email address will not be published. Required fields are marked *