We are now going to see how to control a DC motor from the Galileo board. This is slightly more complex than controlling a relay, as we will need to control both the speed and the direction of the motor. To simplify things, we will use a dedicated component (mounted on an Arduino shield) to control the motor.
For this recipe, we will need two extra components—a DC motor, and an Arduino motor shield.
For the motor, I used a small 5V DC motor. Most 5V motors will work for this recipe.
For the motor shield, I used the official Arduino DC motor shield. However, most shields dedicated to DC motor control will also work for this application. You can, for example, use the SparkFun or DFRobot shields.
This is a list of the components that were used in this project:
You will also need to have your Galileo board ready to use with the Arduino IDE. Please...