#include <Stepper.h>
const int stepsPerRevolution = 200;
int motSpeed = 60;
Stepper myStepper(stepsPerRevolution,8,10,9,11); //nombrar el motor
int BOTON = 6; //PMW
int val;
int grados=0;
void setup() {
Serial.begin(9600);
pinMode(BOTON,INPUT);
myStepper.setSpeed(motSpeed);
}
void loop() {
val=digitalRead(BOTON);
if(val==HIGH);
{
grados++;
int pasos = map(grados, 0,360,0,stepsPerRevolution);
myStepper.step(pasos);
Serial.println("Ángulo: " + String(grados));
}else
}