Answers.Body: <p>Because it takes time to write to the display. The motor speed cannot be changed until the display blocks have finished and your loop repeats.</p>
  
  <p>Try this instead... create a second loop in parallel to the first that handles the display. You will need a new logic variable to send information from the motor loop to the display loop.</p>
  
  <p><a href="https://i.sstatic.net/vSrpR.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vSrpR.png" alt="first two loops"></a>
  <a href="https://i.sstatic.net/Tlfsv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Tlfsv.png" alt="third loop"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-04T08:50:33.977Z
Answers.Text: I tried, same result! What do you mean with "new logic variable"? I used the same "B-Power" and "C-Power" variable that I'm using in the main motor loop
Answers.UserDisplayName: Simone Chelo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-04T18:54:29.423Z
Answers.Text: I have added screenshots to show what I mean. I imagine that it would be better to move the math blocks from the motor loop to the display loop, then you wouldn't need the "Forward" variable.
Answers.UserDisplayName: David Lechner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-03T23:09:33.433Z
Answers.LastActivityDate: 2016-03-04T18:50:01.390Z
Answers.LastEditDate: 2016-03-04T18:50:01.390Z
Answers.UserDisplayName: David Lechner
Body: <p>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.</p>
  
  <p>Here it is:</p>
  
  <p>[<img src="https://i.sstatic.net/NP5FS.png" alt="enter image description here">]</p>
  
  <p>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.</p>
  
  <p>I want now to add some output on the display, like this:</p>
  
  <p><a href="https://i.sstatic.net/Qu7oa.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Qu7oa.png" alt="enter image description here"></a></p>
  
  <p>The idea is: if B power is between C+10 and C-10, then show a forward arrow. else if: if B &lt; C show Right arrow, else Left arrow.</p>
  
  <p>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.</p>
  
  <p>Why does an output operation on the display affects motors power?</p>
  
Tags: <ev3>
Title: Why does display output affects motors?
UserDisplayName: Simone Chelo
ThreadText: # Why does display output affects motors?
  
  (Asked by: username_0 on 2016-03-03)
  
  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:
  
  [![enter image description here](https://i.sstatic.net/NP5FS.png)]
  
  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:
  
  [![enter image description here](https://i.sstatic.net/Qu7oa.png)](https://i.sstatic.net/Qu7oa.png)
  
  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?
  
  **Tags:** ev3
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-03-03. Score: 4 | Accepted answer
  
  Because it takes time to write to the display. The motor speed cannot be changed until the display blocks have finished and your loop repeats.
  
  Try this instead... create a second loop in parallel to the first that handles the display. You will need a new logic variable to send information from the motor loop to the display loop.
  
  [![first two loops](https://i.sstatic.net/vSrpR.png)](https://i.sstatic.net/vSrpR.png)
  [![third loop](https://i.sstatic.net/Tlfsv.png)](https://i.sstatic.net/Tlfsv.png)
  
  > **Comments:**
  > **username_0**: I tried, same result! What do you mean with "new logic variable"? I used the same "B-Power" and "C-Power" variable that I'm using in the main motor loop  
  > **username_1**: I have added screenshots to show what I mean. I imagine that it would be better to move the math blocks from the motor loop to the display loop, then you wouldn't need the "Forward" variable.  
  
  ---
  
  