Motor Control Demo
This section will teach you how to construct the circuit and how to control the motor.
This is a video of the motor control demo:
In the motor control demo, the pendulum base motor turns clockwise for 1 second and then turns counterclockwise for 1 second, and repeats this motion afterwards.
This is the motor and motor controller:

This is the electrical connection of this demo:

Note that we are using Arduino MEGA 2560, thus before uploading the program to Arduino, don't forget to check if this is selected in Arduino programming software:

Also note that the Arduino programming software we use is version 0022.
Program Codes
This is the program code: (available in DOWNLOAD section)
motor_control_demo.pde
motor.pde