Datasheet

DC motor control walkthru
Here's a walkthru of the code which shows you everything the MotorHAT library can do and
how to do it.
Start with importing at least these libraries:
#!/usr/bin/python
from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor
import time
import atexit
The MotorHAT library contains a few different classes, one is the MotorHAT class itself
which is the main PWM controller. You'll always need to create an object, and set the
address. By default the address is 0x60 (see the stacking HAT page on why you may want
to change the address)
# create a default object, no changes to I2C address or frequency
© Adafruit Industries
https://learn.adafruit.com/adafruit-dc-and-stepper-motor-hat-for-
raspberry-pi
Page 23 of 38