3 Stepper Motor Control - one revolution
5 Revisionato per i motori 5v 28YBJ-48 con controller board
6 - http://arduino-info.wikispaces.com/SmallSteppers
8 This program drives a unipolar or bipolar stepper motor.
9 The motor is attached to digital pins 8 - 11 of the Arduino.
11 The motor should revolve one revolution in one direction, then
12 one revolution in the other direction.
23 const int stepsPerRevolution = 2048; // change this to fit the number of steps per revolution
25 // 2048 = 360deg = 32*64 in 4-step sequence as in Step Library
30 // initialize the stepper library on pins 8 through 11:
31 Stepper myStepper(stepsPerRevolution,8,10,9,11);
32 // Sequence is 1-3-2-4
33 // Valid values: (8,10,11,9), (9,11,8,10), (10,8,9,11), and (11,9,10,8)
39 // Max speed is 14RPM @ 5v
42 // set the speed at 60 rpm:
43 myStepper.setSpeed(14); // Max speed is 14RPM @5v
44 // initialize the serial port:
49 // step one revolution in one direction:
50 Serial.println("clockwise");
51 myStepper.step(stepsPerRevolution);
54 // step one revolution in the other direction:
55 Serial.println("counterclockwise");
56 myStepper.step(-stepsPerRevolution);