Answers.Body: <p>Code is works as the robot is behaving. The problem is that the first block is a sensor block, which is processed in the blink of an eye. The second block moves forward for 2 rotations at 50% power.</p>
  
  <p>So long as only one sensor is being watched, a wait for block is sufficient. Here is an example:
  <img src="https://i.sstatic.net/JU1Pc.png" alt="enter image description here"></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-19T23:25:51.507Z
Answers.LastActivityDate: 2014-07-19T23:25:51.507Z
Answers.UserDisplayName: dfrevert
Answers.Body: <p>Are you sure that the button is being completely pressed? A quick test would be to hold the robot and manually press the touch sensor. If the wheels start turning backwards, then there isn't anything wrong, you just need to make sure the button gets pressed completely.</p>
  
  <p>If you're sure the button is being pressed, then it's probably a software problem. It seems like you have a conditional block, is it reading the same port that the sensor is connected to. </p>
  
  <p>You could make a really simple program that has a forward tank movement inside a loop and make the exit condition for the loop be to exit when the button is pressed. If you put an end block after the loop, the robot will drive forward forever until the button is pressed.</p>
  
  <p>Hopefully one of those options will help you fix the problem!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-18T18:26:05.147Z
Answers.LastActivityDate: 2014-07-18T18:26:05.147Z
Answers.UserDisplayName: Doowybbob
Body: <p>My FLL team just got a couple of EV3 sets and the kids were trying to program a simple switch that has the robot drive into a wall, back up, and turn right once the touch sensor in the front is pressed.</p>
  
  <p>The pressed condition in the switch has a move tank going backwards followed by a turn.
  The unpressed condition has a move tank going forward. </p>
  
  <p>The robot just goes forward and does not stop after it runs into the wall and the sensor is clearly pressed.</p>
  
  <h2>We tried switching the bricks, the sensors, the cables, the ports and reinstalling the firmware. Nothing works. Help...</h2>
  
  <p>Thank you for the replies. I'm not sure I'm responding in the right spot but here is the screenshot:</p>
  
  <p><img src="https://i.sstatic.net/Tp9cQ.png" alt="simple_touchsensor_switch"></p>
  
  <p>Also, it's not a port number issue. In fact, when you check the ports on the software it shows that it's recognizing the sensor and its state on the correct port. And it does get pressed. We even tried pressing it manually just to make sure.</p>
  
  <p>I just reinstalled all the software and firmware and now it's not even going through the switch! It just skips it and goes on to the last block. I think I'm out of my depth here...  </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-07-18T20:26:30.713Z
Comments.Text: Please provide a screenshot of the EV3 program.  I suspect the sensor port number is the problem.  The EV3 does some work in the background to get this to work automagically.
Comments.UserDisplayName: dfrevert
Tags: <ev3>
Title: Can't get EV3 to work with touch sensors
UserDisplayName: user3848
ThreadText: # Can't get EV3 to work with touch sensors
  
  (Asked by: username_0 on 2014-07-18)
  
  My FLL team just got a couple of EV3 sets and the kids were trying to program a simple switch that has the robot drive into a wall, back up, and turn right once the touch sensor in the front is pressed.
  
  The pressed condition in the switch has a move tank going backwards followed by a turn.
  The unpressed condition has a move tank going forward.
  
  The robot just goes forward and does not stop after it runs into the wall and the sensor is clearly pressed.
  
  ## We tried switching the bricks, the sensors, the cables, the ports and reinstalling the firmware. Nothing works. Help...
  
  Thank you for the replies. I'm not sure I'm responding in the right spot but here is the screenshot:
  
  ![simple_touchsensor_switch](https://i.sstatic.net/Tp9cQ.png)
  
  Also, it's not a port number issue. In fact, when you check the ports on the software it shows that it's recognizing the sensor and its state on the correct port. And it does get pressed. We even tried pressing it manually just to make sure.
  
  I just reinstalled all the software and firmware and now it's not even going through the switch! It just skips it and goes on to the last block. I think I'm out of my depth here...
  
  **Tags:** ev3
  > **Comments:**
  > **username_1**: Please provide a screenshot of the EV3 program.  I suspect the sensor port number is the problem.  The EV3 does some work in the background to get this to work automagically.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2014-07-19. Score: 1
  
  Code is works as the robot is behaving. The problem is that the first block is a sensor block, which is processed in the blink of an eye. The second block moves forward for 2 rotations at 50% power.
  
  So long as only one sensor is being watched, a wait for block is sufficient. Here is an example:
  ![enter image description here](https://i.sstatic.net/JU1Pc.png)
  
  
  ---
  
  ### Answer by username_2 on 2014-07-18. Score: 1
  
  Are you sure that the button is being completely pressed? A quick test would be to hold the robot and manually press the touch sensor. If the wheels start turning backwards, then there isn't anything wrong, you just need to make sure the button gets pressed completely.
  
  If you're sure the button is being pressed, then it's probably a software problem. It seems like you have a conditional block, is it reading the same port that the sensor is connected to.
  
  You could make a really simple program that has a forward tank movement inside a loop and make the exit condition for the loop be to exit when the button is pressed. If you put an end block after the loop, the robot will drive forward forever until the button is pressed.
  
  Hopefully one of those options will help you fix the problem!
  
  
  ---
  
  