Close

Code for the Adafruit Motor Shield V2

A project log for SpiroBot

Educational Arduino based polar geometry drawing system.

Owen LiOwen Li 08/15/2015 at 02:260 Comments

For this particular project, we chose to use a motor shield to make the code simpler. In this case, we bought an Adafruit Motor Shield V2 for Arduino. Adafruit has created their own library to go with the motor shield. The library contains shortcuts for running servos, DC motors, and steppers. In addition, it is compatible with the AccelStepper library. The AccelStepper library is what we mainly use. It gives the user control of the stepper using position, velocity, and acceleration functions. Using the position function, we are able to write a mathematical equation to express the position we want the stepper at with respect to time. Using some calculus, we can extend this and make use of the velocity and acceleration functions if we wanted to.


More information on the Adafruit Motorshield kit.

More information on the AccelStepper library.

Discussions