Hello !
I’m using the LineFollower example from the Zumo32U4 Library and I’m experiencing some unexpected results.
When I run the code as it is the robot follows the line without any problem. However when I change this line :
int16_t speedDifference = error / 4 + 6 * (error - lastError);
To this line :
int16_t speedDifference = (1/4) * error + 6 * (error - lastError);
My zumo is experiencing some trouble following the line.
And when I try :
int16_t speedDifference = 4 * error + 6 * (error - lastError);
The result seems the same as with error/4
Now I’ve searched for an explanation to that issue but I don’t understand how it’s possible as it is exactly the same calcul.
Can anyone tell me why this happens ?
Many thanks !