Quote:
Originally Posted by Mubtasim
We are trying to make it so that when the joystick signals to seed up, there has to be several milliseconds delays in order to gradually increase the speed. Is there any simple way to do this? [ using simple robot template ]
Thanks
|
You can keep track of an output variable and add a percentage of the error between it and the desired output each loop. Something like:
Code:
float output = 0.0;
while(true)
{
float desired = joystick.getY();
float error = desired - output;
output += error * 0.1;
motor.set(output);
}