aboutsummaryrefslogtreecommitdiff
path: root/libraries/Stepper/examples/MotorKnob/MotorKnob.pde
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2009-11-07 17:54:56 +0000
committerDavid A. Mellis <d.mellis@arduino.cc>2009-11-07 17:54:56 +0000
commit6005c59ad03446153c66a991f01ac91c31d98dac (patch)
tree4c599359fd35066a81b8b9fe99042e325c03c6ed /libraries/Stepper/examples/MotorKnob/MotorKnob.pde
parent584dece7b0c982de8731f7400c94b5034aef89e7 (diff)
Moving libraries out of arduino platform / core directory and to top-level.
Diffstat (limited to 'libraries/Stepper/examples/MotorKnob/MotorKnob.pde')
-rw-r--r--libraries/Stepper/examples/MotorKnob/MotorKnob.pde40
1 files changed, 0 insertions, 40 deletions
diff --git a/libraries/Stepper/examples/MotorKnob/MotorKnob.pde b/libraries/Stepper/examples/MotorKnob/MotorKnob.pde
deleted file mode 100644
index 062cac9..0000000
--- a/libraries/Stepper/examples/MotorKnob/MotorKnob.pde
+++ /dev/null
@@ -1,40 +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
- */
-
-#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