Answers.Body: <p>Nothing is halting the "02" loop.  It is running forever.</p>
  
  <p>The problem with the second loop is that "brown" is the default.  The switch looks for "white" and anything else uses the "brown" side of the switch.  I suspect you want the lower half of the switch statement to be "any color but brown".  If so, the "default" button needs to be selected for the "white" switch choice.</p>
  
  <p>As for the "01" loop, the content of the loop always runs a first time.  If at the end of one rotation, the color sensor does not see "white" it jumps out of the loop and the program enters the "02" loop.</p>
  
  <p>I'd recommend using the LCD block to write the results of color sensor measurements to the EV3 LCD.  It's a basic tool for debugging.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-14T04:17:42.223Z
Answers.LastActivityDate: 2014-03-14T04:17:42.223Z
Answers.UserDisplayName: dfrevert
Body: <p>I don't see what is wrong with the way i made my program. </p>
  
  <p>It looks like this. </p>
  
  <p><img src="https://i.sstatic.net/8Py0T.png" alt="enter image description here"></p>
  
  <p>The idea is that in the while loop [01] shall the robot move forward until it see something brown. </p>
  
  <p>If it see something brown it should jump to the second while loop, where it will move forward it sees something brown,  and if it sees something white it should move backwards. </p>
  
  <p>But for some reason  it immediately goes to the second while loop, and stays only at the first for few sec.? ??</p>
  
  <p>What am i doing wrong?? </p>
  
Tags: <ev3><programming>
Title: EV3 Block problems?
UserDisplayName: Guest
ThreadText: # EV3 Block problems?
  
  (Asked by: username_0 on 2014-03-13)
  
  I don't see what is wrong with the way i made my program.
  
  It looks like this.
  
  ![enter image description here](https://i.sstatic.net/8Py0T.png)
  
  The idea is that in the while loop [01] shall the robot move forward until it see something brown.
  
  If it see something brown it should jump to the second while loop, where it will move forward it sees something brown, and if it sees something white it should move backwards.
  
  But for some reason it immediately goes to the second while loop, and stays only at the first for few sec.? ??
  
  What am i doing wrong??
  
  **Tags:** ev3, programming
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-03-14. Score: 4
  
  Nothing is halting the "02" loop. It is running forever.
  
  The problem with the second loop is that "brown" is the default. The switch looks for "white" and anything else uses the "brown" side of the switch. I suspect you want the lower half of the switch statement to be "any color but brown". If so, the "default" button needs to be selected for the "white" switch choice.
  
  As for the "01" loop, the content of the loop always runs a first time. If at the end of one rotation, the color sensor does not see "white" it jumps out of the loop and the program enters the "02" loop.
  
  I'd recommend using the LCD block to write the results of color sensor measurements to the EV3 LCD. It's a basic tool for debugging.
  
  
  ---
  
  