| Package | org.MARS.robot.sensors |
| Class | public class LineSensor |
| Inheritance | LineSensor AbstractSensor AbstractElectronicDevice |
See also
| Method | Defined by | ||
|---|---|---|---|
|
LineSensor(x:Number, y:Number, size:Number = 5)
Creates a sensor with the given parameters.
| LineSensor | ||
![]() |
Get a certain IO port by its number
| AbstractElectronicDevice | |
|
getReading():void
Determine if the sensor is on the line and set the
output port accordingly: HIGH if the sensor is on the
line and LOW if the sensor is off the line.
| LineSensor | ||
| LineSensor | () | constructor |
public function LineSensor(x:Number, y:Number, size:Number = 5)Creates a sensor with the given parameters.
NOTE: the shape of the sensing area of the line sensors such as QRD1114 is always a small square
Parametersx:Number — - x coordinate relative to the center of the robot
|
|
y:Number — - y coordinate relative to the center of the robot
|
|
size:Number (default = 5) — - size of the sensor (5 by default)
|
| getReading | () | method |
public override function getReading():voidDetermine if the sensor is on the line and set the output port accordingly: HIGH if the sensor is on the line and LOW if the sensor is off the line.
See also