il problema è che se supero i 300 vibra solo e non gira ecco il codice
#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
void setup()
{
Serial.begin(9600);
pinMode(6, INPUT);
pinMode(7, INPUT);
// set the speed of the motor to 30 RPMs
stepper.setSpeed(300);
}
void loop()
{
// get the sensor value
int buttonState = digitalRead(6);
int buttonState2 = digitalRead(7);
if (buttonState==HIGH){
stepper.step(2000);
}
if (buttonState2==HIGH){
stepper.step(-2000);
}
Serial.println(buttonState);
Serial.println(buttonState2);