in fact as you can see i dont need the if(Floor==1) i can be only testing the digital read as if(val1==HIGH).....
that was the main doubt i had, am used to program in c++(and this its not c++), so im not sure tha if i select the variable Floor for the switch sentence its ok, or its the biggest mistake on the code, because i am using the memory of the counter Floor for the program to decide de case,
for example in case 1: the counter Floor values 1, and depending on the state of the buttons i get the direction of the stepper..
{
case 1:
{if (val1==HIGH)
{
myStepper.step(0);
Floor=Floor;
}
if(val2==HIGH)
{
myStepper.step(400);//here its my problem i want to move the stepper till its reach the hall sensor
Floor++;
}
if(val3==HIGH)
{
myStepper.step(400);
Floor=Floor+2;
}
if(val4==HIGH)
{
myStepper.step(400);
Floor=Floor+3;
}
}
break;