What is a Touch Sensor?

From ROBOTC API Guide
Jump to: navigation, search


A touch sensor is a simple mechanism that contains a button and a switch. When the button is pressed, the switch is thrown and the circuits inside of the sensor connect. This means that the sensor returns a different value when the button is pressed than when the button is not pressed. In general, while the button is not pressed, the touch sensor returns a value of zero, and when pressed, it returns a value of one. The button on the LEGO touch sensor is a momentary push button, which means that it returns to its open (unpressed) state whenever no pressure is being applied to it.

A LEGO touch sensor