Packageorg.MARS.robot.control
Classpublic class SquidTestBrain
InheritanceSquidTestBrain Inheritance AbstractElectronicDevice
ImplementsIController

The Squid Test Brain is a programmable controller designed for a specific purpose and a specific robot. The robot must find it's way to the goal on the other side of a table by following the lines and avoiding the moving 'Squid' robot.

IO Port configuration:
0 through 3 - outputs (must be connected directly to the locomotion)
4 and 5 - inputs from line sensors (4 - left, 5 - right)
6 and 7 - inputs from IR sensors (6 - left, 7 - right)
8 and 9 - inputs from edge sensors (8 - left, 9 - right)
10 - output to an LED

See also

IOPort
Robot
ILocomotion


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 Squid Test Brain controller
SquidTestBrain
 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.
SquidTestBrain
Protected Methods
 MethodDefined by
  
SquidTestBrain
  
SquidTestBrain
  
SquidTestBrain
  
SquidTestBrain
  
SquidTestBrain
  
SquidTestBrain
Public Constants
 ConstantDefined by
  LED_PORT : Number = 10
[static]
SquidTestBrain
  LEFT_EDGE_SENSOR_PORT : Number = 8
[static]
SquidTestBrain
  LEFT_IR_SENSOR_PORT : Number = 6
[static]
SquidTestBrain
  LEFT_LINE_SENSOR_PORT : Number = 4
[static]
SquidTestBrain
  LEFT_MOTOR_PORT_A : Number = 0
[static]
SquidTestBrain
  LEFT_MOTOR_PORT_B : Number = 1
[static]
SquidTestBrain
  RIGHT_EDGE_SENSOR_PORT : Number = 9
[static]
SquidTestBrain
  RIGHT_IR_SENSOR_PORT : Number = 7
[static]
SquidTestBrain
  RIGHT_LINE_SENSOR_PORT : Number = 5
[static]
SquidTestBrain
  RIGHT_MOTOR_PORT_A : Number = 2
[static]
SquidTestBrain
  RIGHT_MOTOR_PORT_B : Number = 3
[static]
SquidTestBrain
Constructor detail
SquidTestBrain()constructor
public function SquidTestBrain()

Create a Squid Test Brain controller

Method detail
leftWheelForward()method
protected function leftWheelForward():void
leftWheelReverse()method 
protected function leftWheelReverse():void
leftWheelStop()method 
protected function leftWheelStop():void
rightWheelForward()method 
protected function rightWheelForward():void
rightWheelReverse()method 
protected function rightWheelReverse():void
rightWheelStop()method 
protected function rightWheelStop():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
LED_PORTconstant
public static const LED_PORT:Number = 10
LEFT_EDGE_SENSOR_PORTconstant 
public static const LEFT_EDGE_SENSOR_PORT:Number = 8
LEFT_IR_SENSOR_PORTconstant 
public static const LEFT_IR_SENSOR_PORT:Number = 6
LEFT_LINE_SENSOR_PORTconstant 
public static const LEFT_LINE_SENSOR_PORT:Number = 4
LEFT_MOTOR_PORT_Aconstant 
public static const LEFT_MOTOR_PORT_A:Number = 0
LEFT_MOTOR_PORT_Bconstant 
public static const LEFT_MOTOR_PORT_B:Number = 1
RIGHT_EDGE_SENSOR_PORTconstant 
public static const RIGHT_EDGE_SENSOR_PORT:Number = 9
RIGHT_IR_SENSOR_PORTconstant 
public static const RIGHT_IR_SENSOR_PORT:Number = 7
RIGHT_LINE_SENSOR_PORTconstant 
public static const RIGHT_LINE_SENSOR_PORT:Number = 5
RIGHT_MOTOR_PORT_Aconstant 
public static const RIGHT_MOTOR_PORT_A:Number = 2
RIGHT_MOTOR_PORT_Bconstant 
public static const RIGHT_MOTOR_PORT_B:Number = 3