Installing Software

We have a Python library you can use to control DC and stepper motors, its probably the easiest way to get started, and python has support for multithreading which can be really handy when running multiple stepper motors at onces!

Before you start, you'll need to have the python smbus library installed as well as 'git', run apt-get install python-smbus git

Downloading the Code from Github

The easiest way to get the code onto your Pi is to hook up an Ethernet cable or with a WiFi setup, 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"):

git clone
cd Adafruit-Motor-HAT-Python-Library

Install python-dev if you havent already:

sudo apt-get update
sudo apt-get install build-essential python-dev python-pip

Now install it with the setup install command:

sudo python install

That's it! Now you can get started with testing. Run

cd examples

from within the Motor HAT library folder, we have a couple examples to demonstrate the different types of motors and configurations. The next few pages will explain them

Last updated on 2018-04-24 at 10.57.54 AM Published on 2015-01-27 at 01.29.59 PM