#include <Stepper.h>
#define pinHe 0
#define pin1 8
#define pin2 9
#define pin3 10
#define pin4 11

const int stepsPerRevolution = 200;
int valorSensor = 0;

Stepper miMotor(stepsPerRevolution, pin1, pin2, pin3, pin4);

void setup() {
  // put your setup code here, to run once:
  miMotor.setSpeed(30);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  valorSensor = analogRead(pinHe);
  Serial.println(valorSensor);
  if(valorSensor > 605){
    miMotor.step(-1);
  }
  else{
    digitalWrite(pin1, LOW);
    digitalWrite(pin2, LOW);
    digitalWrite(pin3, LOW);
    digitalWrite(pin4, LOW);
  }
}
