[SOLVED]Why do i get this error?

void motor1Move(unsigned long x){
   if (motor1.isDone())  
 {  
   //Intervalo entre acionamentos  
   delay(1);
   //Define o sentido de rotacao (CW = Horario)  
   motor1.setDirection(CW);  
   //Define o angulo de rotacao  
   motor1.rotateDegrees(x);  
  }  

  motor1.run();  
}
unsigned long degrees_count(){
  unsigned long a = 0;
  while(a<18){
    a++;
    delay(330);
   return a;
    
  }
  
}
void scan(){
  motor1Move(degrees_count);
  
}
    

void loop(){
motor1Move(degrees_count);
  
}

I get the following error at this part of the code :
invalid conversion from ‘long unsigned int (*)()’ to ‘long unsigned int’
error: initializing argument 1 of ‘void motor1Move(long unsigned int)’

Hi Smug

Try changing this

motor1Move(degrees_count)

to this:

motor1Move(degrees_count())

When you call a function which has no arguments, you still need to include ().

Regards

Ray

=D
Thanks so much, i was distracted and forgot that!

  unsigned long a = 0;
  while(a<18){
    a++;
    delay(330);
   return a;
    
  }

Pretty stupid looking while loop, there. How many times will the loop iterate? Under what circumstances can the function every do anything but piss away a third of a second and then return 1?