Packageorg.MARS.robot.sensors
Classpublic class TouchSensor
InheritanceTouchSensor Inheritance AbstractSensor Inheritance AbstractElectronicDevice

The simple touch sensor which uses a mechanical switch to locate the walls or heavy objects on the surface of the table.

See also

getReading()


Public Properties
 PropertyDefined by
 InheritednumberOfPorts : Number
Get the number of IO ports in the device.
AbstractElectronicDevice
 Inheritedshape : Shape
The shape of the sensor
AbstractSensor
 Inheritedtype : Class
The type of the sensor
AbstractSensor
Protected Properties
 PropertyDefined by
 Inherited_ports : Array
AbstractElectronicDevice
 Inherited_shape : Shape
AbstractSensor
 Inherited_type : Class
AbstractSensor
Public Methods
 MethodDefined by
  
Creates a sensor with the given shape
TouchSensor
 Inherited
getPort(portNumber:Number):IOPort
Get a certain IO port by its number
AbstractElectronicDevice
  
getReading():void
Determine if the sensor collides with an object and set the output port accordingly: HIGH if the sensor detects a collision and LOW if the sensor does not.
TouchSensor
Constructor detail
TouchSensor()constructor
public function TouchSensor(shape:Shape)

Creates a sensor with the given shape

Parameters
shape:Shape

See also

Shape
Method detail
getReading()method
public override function getReading():void

Determine if the sensor collides with an object and set the output port accordingly: HIGH if the sensor detects a collision and LOW if the sensor does not.

See also

Environment.isCollidingWithWall()