Page 342 - Making things move_ DIY mechanisms for inventors, hobbyists, and artists
P. 342
Chapter 10 Projects 319
FIGURE 10-28 SADbot’s first drawing in the Eyebeam window gallery
CC-GNU GPL by Ben Leduc-Mills and Dustyn Roberts
Created: 2010.06
*/
#include <Stepper.h> //import stepper library
#define STEPS 200 // 360/1.8 (step angle) = 200 steps/revolution
//declare new stepper objects from stepper library (one per motor)
Stepper right_motor(STEPS, 6, 7); //6=DIR, 7=STEP
Stepper left_motor(STEPS, 11, 12); //11=DIR, 12=STEP
int distance; // how far motors should go
int lowest; // to store lowest photocell value
int i; // for looping