diff options
author | Cristian Maglie <c.maglie@bug.st> | 2013-08-08 16:43:19 +0200 |
---|---|---|
committer | Cristian Maglie <c.maglie@bug.st> | 2013-08-08 16:43:19 +0200 |
commit | a8193ed933d9c9954cefbfb541cde56770ab5b74 (patch) | |
tree | 80796833fecca5d7426f1d09f7ac9870bab5f062 /libraries/Stepper/examples/MotorKnob/MotorKnob.ino | |
parent | a4c9fee673342304a5b12f7f2f7f9ecb9cb26d30 (diff) | |
parent | 5527c44aa443b20d63cf7a276180a36695233924 (diff) |
Merge branch 'ide-1.5.x-library-to-new-format' into ide-1.5.x
Diffstat (limited to 'libraries/Stepper/examples/MotorKnob/MotorKnob.ino')
-rw-r--r-- | libraries/Stepper/examples/MotorKnob/MotorKnob.ino | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/libraries/Stepper/examples/MotorKnob/MotorKnob.ino b/libraries/Stepper/examples/MotorKnob/MotorKnob.ino deleted file mode 100644 index d428186..0000000 --- a/libraries/Stepper/examples/MotorKnob/MotorKnob.ino +++ /dev/null @@ -1,41 +0,0 @@ -/* - * MotorKnob - * - * A stepper motor follows the turns of a potentiometer - * (or other sensor) on analog input 0. - * - * http://www.arduino.cc/en/Reference/Stepper - * This example code is in the public domain. - */ - -#include <Stepper.h> - -// change this to the number of steps on your motor -#define STEPS 100 - -// create an instance of the stepper class, specifying -// the number of steps of the motor and the pins it's -// attached to -Stepper stepper(STEPS, 8, 9, 10, 11); - -// the previous reading from the analog input -int previous = 0; - -void setup() -{ - // set the speed of the motor to 30 RPMs - stepper.setSpeed(30); -} - -void loop() -{ - // get the sensor value - int val = analogRead(0); - - // move a number of steps equal to the change in the - // sensor reading - stepper.step(val - previous); - - // remember the previous value of the sensor - previous = val; -}
\ No newline at end of file |