Hi i have problem with function to control my 4servos. I want to take this code to function but it's not working.
volatile float servo1;
variable= uart_getchar();
_delay_ms(100);
variable=variable/10;
servo1=variable;
sprintf(bufor,"Servo_1= %4.1f\n",servo1);
uart_puts(bufor);
when this code is not in function everything is okay, servo works good. Problem is when i do this:
void get(float Servo, char Number)
{
variable= uart_getchar();
_delay_ms(100);
variable=variable/10;
Servo=variable;
sprintf(bufor,"Serwo_%c= %4.1f\n",Number,Servo);
uart_puts(bufor);
}
and when i call get(servo1,'1');
servo stayed in the same place all the time.. any idea what is wrong??