Why is delay not working in this case?

#include <CustomStepper.h>  
   
//Define os parametros iniciais de ligacao do motor de passo  
CustomStepper stepper(8, 9, 10, 11, (byte[]){8, B1000, B1100, B0100, 
B0110, B0010, B0011, B0001, B1001}, 4075.7728395, 12, CW);  
int a = 0;
float tempo;

void setup()  
{  
  //Define a velocidade do motor  
  stepper.setRPM(12);  
  //Define o numero de passos por rotacao  
  stepper.setSPR(4075.7728395);  
  
}  
void rodarGraus(int x){
  tempo = x/83.88;
  stepper.rotateDegrees(x);
  delay(tempo);
 
}
void loop()  
{  
 if (stepper.isDone())  
 { 
   while(a<100){
   stepper.setDirection(CW); 
   rodarGraus(900);
   a++;
   }
 }
  stepper.run();  
}

So, i’d like that could do the “rodarGraus” function 100 times, but, the while loop just ignores the delay, so the “rodarGraus” function can’t even be completed once, what should i do?

Delay will only take an int argument, you are passing it a float. Delay is not being ignored.

Thanks for replying, i changed the delay value from float to int, but even tought, the same thing happens...

You are using the word ignor do you mean that? Ignore means not to bother with it as if it were not there. But then you say it does not compleat the function because of the delay. Those two things are contidictary, which is it?

No no, nothing changed when i changed delay to int.

The program is not executing the "rodarGraus" 100 times, because the while loop is finishing so fast, that not even once "rodarGraus" can be completed, that means that the program is not executing the delay command...

in other words, 10 milliseconds is a very short moment

tempo = x/83.88;

Thanks, now i’ve changed it to: (x*1000)/83.88;
ty

Smug: Thanks, now i've changed it to: (x*1000)/83.88; ty

delay takes an unsigned long, actually

you probably want to initialize tempo as an unsigned long

and then change this:

tempo = x*1000/83.88;

to this:

tempo = x*1000UL/83.88;

you may otherwise overflow your int...

CustomStepper stepper(8, 9, 10, 11, (byte[]){8, B1000, B1100, B0100, 
B0110, B0010, B0011, B0001, B1001}, 4075.7728395, 12, CW);

What is this rubbish? You can't create an array on-the-fly like that.