| Package | org.MARS.robot.control |
| Class | public class BrainTwo |
| Inheritance | BrainTwo BrainOne AbstractElectronicDevice |
| Implements | IController |
IO Port configuration:
0 and 1 - inputs from sensors (0 - left, 1 - right)
2 through 5 - outputs (must be connected directly to the locomotion)
See also
| Method | Defined by | ||
|---|---|---|---|
|
BrainTwo(ld:Number, rd:Number)
Creates a Brain Two with the timers connected to the
left and right motors set to the number of seconds provided.
| BrainTwo | ||
![]() |
Get a certain IO port by its number
| AbstractElectronicDevice | |
![]() |
setTimers(ld:Number, rd:Number):void
Set the values of the Brain's timers to the provided ones
| BrainOne | |
|
step():void
A function that is called on every step of the physics engine.
| BrainTwo | ||
| BrainTwo | () | constructor |
public function BrainTwo(ld:Number, rd:Number)Creates a Brain Two with the timers connected to the left and right motors set to the number of seconds provided.
NOTE: using timers of slightly different values will help the robot to avoid getting stuck in on place whenever it's movement is perpendicular to the edge of the surface.
Parametersld:Number — - left timer (in seconds)
|
|
rd:Number — - right timer (in seconds)
|
| step | () | method |
public override function step():voidA function that is called on every step of the physics engine. It advances the timers and reverses the motors whenever needed.