Answers.Body: <p>The loop does stop but you can not see it: You should add a brake block after the loop that runs until colour sensor&lt;20 otherwise there is no visible indication that the loop has stopped. Hope this helped.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-06T16:07:00.120Z
Answers.LastActivityDate: 2018-07-06T16:07:00.120Z
Answers.UserDisplayName: Vikhyat Agarwal
Body: <p>I am trying to create a robot that follows a line. I want the robot to turn on its vertical axis ("move-tank") until it finds the line again and then keep going straight. My problem is that the "repeat turning until color sensor value is less than 20" loop does not stop although the sensor value meets the criteria (i.e. less than 20). </p>
  
  <p>This is my code:</p>
  
  <p><a href="https://i.sstatic.net/mLr1m.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/mLr1m.jpg" alt="enter image description here"></a></p>
  
  <p>Any ideas what am I doing wrong? </p>
  
  <p>The logic inside the loop 02 is that it turns tank-left (-10,10) for 0.5, then it turns tank-right (-1 x -10, -1 x 10) for 0.5 + 0.3 seconds, etc until it finds the line (sensor value &lt; 20). </p>
  
Tags: <sensor-colour>
Title: Repeat until sensor value is accepted does not work.
UserDisplayName: xpanta
ThreadText: # Repeat until sensor value is accepted does not work.
  
  (Asked by: username_0 on 2018-07-03)
  
  I am trying to create a robot that follows a line. I want the robot to turn on its vertical axis ("move-tank") until it finds the line again and then keep going straight. My problem is that the "repeat turning until color sensor value is less than 20" loop does not stop although the sensor value meets the criteria (i.e. less than 20).
  
  This is my code:
  
  [![enter image description here](https://i.sstatic.net/mLr1m.jpg)](https://i.sstatic.net/mLr1m.jpg)
  
  Any ideas what am I doing wrong?
  
  The logic inside the loop 02 is that it turns tank-left (-10,10) for 0.5, then it turns tank-right (-1 x -10, -1 x 10) for 0.5 + 0.3 seconds, etc until it finds the line (sensor value < 20).
  
  **Tags:** sensor-colour
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-07-06. Score: 2 | Accepted answer
  
  The loop does stop but you can not see it: You should add a brake block after the loop that runs until colour sensor<20 otherwise there is no visible indication that the loop has stopped. Hope this helped.
  
  
  ---
  
  