4
* A stepper motor follows the turns of a potentiometer
5
* (or other sensor) on analog input 0.
7
* http://www.arduino.cc/en/Reference/Stepper
8
* This example code is in the public domain.
13
// change this to the number of steps on your motor
16
// create an instance of the stepper class, specifying
17
// the number of steps of the motor and the pins it's
19
Stepper stepper(STEPS, 8, 9, 10, 11);
21
// the previous reading from the analog input
26
// set the speed of the motor to 30 RPMs
32
// get the sensor value
33
int val = analogRead(0);
35
// move a number of steps equal to the change in the
37
stepper.step(val - previous);
39
// remember the previous value of the sensor
b'\\ No newline at end of file'