Controlling DC Motors (with the motor bonnet) more documentation here
Plug the “bonnet” in while the pi is turned off
Do not reverse the orientation of the "bonnet" or you will damage the Pi
2. Hook up your motor and a power supply
3. Install the required software:
From the Pi’s terminal, type the following:
sudo pip3 install adafruit-circuitpython-motorkit
4. Run this example code in Thonny dc_motor_bonnet.py
5. Plug in the motor power (9v) and the motor should turn
In some cases a battery pack (like in the servo example) will also be fine.
Challenges:
Experiment with the speed of the motor. For example, try kit.motor1.throttle = 0.3
Can you get two motors turning?
Can you have a motor turn for 5 seconds when a button is pressed (ask the instructor for a stacking header)
Can you have a motor turn only when the device is in the dark? (ask the instructor for a stacking header)
Can you control a motor over the internet with a custom interface?