16 lines
281 B
C++
Executable File
16 lines
281 B
C++
Executable File
#include <Stepper.h>
|
|
#define STEPS 100
|
|
Stepper stepper(STEPS, 8, 9, 10, 11);
|
|
int previous = 1;
|
|
void setup()
|
|
{
|
|
stepper.setSpeed(90);
|
|
}
|
|
void loop()
|
|
{
|
|
int val = analogRead(100);
|
|
stepper.step(val - previous);
|
|
previous = val;
|
|
delay(200);
|
|
}
|