
200 Make: Robotic Arms
GND pin of the microcontroller as well to ensure that power and signals are
flowing smoothly between the motor-driver circuitry and the microcontroller.
In addition, most stepper motors require a much higher electrical current
than most microcontrollers can handle—and, though it is not shown in the
diagram on page 199, most stepper motors will require a dedicated power
supply that provides the motor with 12 V to move the motor and achieve the
strength and accuracy the motor was designed to provide.
SAMPLE STEPPERMOTOR ARDUINO CODE
#include <AccelStepper.h>
AccelStepper stepper1(1, 9, 8);
int posOne = 45;
void setup()
{
stepper1 ...