Datasheet

following:
Adafruit_MotorHAT.FORWARD - DC motor spins forward
Adafruit_MotorHAT.BACKWARD - DC motor spins forward
Adafruit_MotorHAT.RELEASE - DC motor is 'off', not spinning but will also not hold
its place.
while (True):
print "Forward! "
myMotor.run(Adafruit_MotorHAT.FORWARD)
print "\tSpeed up..."
for i in range(255):
myMotor.setSpeed(i)
time.sleep(0.01)
print "\tSlow down..."
for i in reversed(range(255)):
myMotor.setSpeed(i)
time.sleep(0.01)
print "Backward! "
myMotor.run(Adafruit_MotorHAT.BACKWARD)
print "\tSpeed up..."
for i in range(255):
myMotor.setSpeed(i)
time.sleep(0.01)
print "\tSlow down..."
for i in reversed(range(255)):
myMotor.setSpeed(i)
time.sleep(0.01)
print "Release"
myMotor.run(Adafruit_MotorHAT.RELEASE)
time.sleep(1.0)
© Adafruit Industries
https://learn.adafruit.com/adafruit-dc-and-stepper-motor-hat-for-
raspberry-pi
Page 25 of 38