I'm making a simple program with LEGO EV3 Education. It makes a little tank to follow a black line over a white-ish floor.
Here it is:
[]
This works very smooth: it makes the tank follow the EDGE of the line and substantially takes in account the amount of light the sensor recevies. Black is 11, White is 75: if the light is near 75, then take the power of the B (left) motor higher than the C (right) motor. if the light is near 11, then take the power of C motor higher than B. Otherwise, make C and B power similar.
I want now to add some output on the display, like this:
The idea is: if B power is between C+10 and C-10, then show a forward arrow. else if: if B < C show Right arrow, else Left arrow.
Problem is that, adding this code, the tank doesn't move straight anymore! C and B motor ,on a stright line, alternate power making the robot zig zagging the line.
Why does an output operation on the display affects motors power?