Touch Sensors

Home > Activities > Robots > Tutorials > Touch Sensors

Computer Challenge logo

Previous page in activity Next page in activity

Wait for Push

Suppose you want your robot to go forward until it bumps into something, then stop. You can use a touch sensor and the Wait for Push function to do this:

wait for touch diagram

You can read this program as:

  • Begin the program
  • Start motors A and C forward (go forward)
  • Wait until the touch sensor connected to input touch sensor icon is pushed in (keep going until you bump into something)
  • Stop all motors
  • End the program

You can find the Wait for Push function by clicking the Wait For wait for button button on the Functions Palette. This brings up the subpalette of wait functions. With wait functions, it is the program that waits at that step, not the robot. The robot keeps going until you tell it to stop.

back | next

© 2012 Computer Challenge