Packageorg.MARS.robot.control
Classpublic class LineFollowingBrain
InheritanceLineFollowingBrain Inheritance AbstractElectronicDevice
ImplementsIController

The Line Following Brain is a programmable controller device. It is programmed to read the inputs from the two line sensors and follow the edge of the line.
The brain uses the following algorithm to follow a line:
Public Properties
 PropertyDefined by
 InheritednumberOfPorts : Number
Get the number of IO ports in the device.
AbstractElectronicDevice
Protected Properties
 PropertyDefined by
 Inherited_ports : Array
AbstractElectronicDevice
Public Methods
 MethodDefined by
  
Create a Line Following Brain controller
LineFollowingBrain
 Inherited
getPort(portNumber:Number):IOPort
Get a certain IO port by its number
AbstractElectronicDevice
  
step():void
A function that is called on every step of the physics engine.
LineFollowingBrain
Protected Methods
 MethodDefined by
  
LineFollowingBrain
  
LineFollowingBrain
  
LineFollowingBrain
  
LineFollowingBrain
Public Constants
 ConstantDefined by
  LEFT_SENSOR_PORT : Number = 0
[static]
LineFollowingBrain
  RIGHT_SENSOR_PORT : Number = 1
[static]
LineFollowingBrain
Constructor detail
LineFollowingBrain()constructor
public function LineFollowingBrain()

Create a Line Following Brain controller

Method detail
leftWheelForward()method
protected function leftWheelForward():void
leftWheelReverse()method 
protected function leftWheelReverse():void
rightWheelForward()method 
protected function rightWheelForward():void
rightWheelReverse()method 
protected function rightWheelReverse():void
step()method 
public function step():void

A function that is called on every step of the physics engine. It reads the sensors' input and reverses the motors whenever needed.

Constant detail
LEFT_SENSOR_PORTconstant
public static const LEFT_SENSOR_PORT:Number = 0
RIGHT_SENSOR_PORTconstant 
public static const RIGHT_SENSOR_PORT:Number = 1