/*
* 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
// Adjust this based on your specific motor's step count
#define STEPS 100
// Initialize the stepper class by defining
// the step count and the specific pins used for
// the connection
Stepper stepper(STEPS, 8, 9, 10, 11);
// Stores the last recorded analog input value
int previous = 0;
void setup()
{
// Set the motor rotation speed to 30 RPM
stepper.setSpeed(30);
}
void loop()
{
// Read the current sensor value
int val = analogRead(0);
// Move the motor a distance proportional to the
// change in the sensor data
stepper.step(val - previous);
// Update the previous value for the next iteration
previous = val;
}
If my interpretation is correct, then 😢
Pardon the persistence, but I am simply intent on learning.