apuntes_Arduino/motores/pap/stepper_keystudio/stepper_keystudio.ino
jp.av.dev 85bf8bb429 proyectos renombrados, reestructuracion
pendientes crear, indexar y linkear readmes
2022-04-04 01:11:04 -04:00

16 lines
308 B
C++
Executable File

#include <Stepper.h>
#define STEPS 100
Stepper stepper(STEPS, 8, 9, 10, 11);
int previous = 0;
void setup() {
stepper.setSpeed(120);
Serial.begin(9600);
}
void loop()
{
int val = analogRead(0);
Serial.println(val);
stepper.step(val - previous);
previous = val;
}