|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
real.RealRCX
This class implements the simple commands provided by AbstractRobot with real lejos commands, allowing the simple commands to be run on the real RCX.
Field Summary | |
static int |
MOTOR_POWER
|
Constructor Summary | |
RealRCX(Controller controller)
Initialises necessary variables, and sets up sensors, currently fixed to: |
Method Summary | |
void |
backward()
Sets the robot moving backwards, this will continue until some other method is called to stop it. |
void |
backward(int time)
Makes the robot move backwards for the given amount of time |
void |
beep()
Makes the robot beep |
void |
forward()
Sets the robot moving forwards, this will continue until some other method is called to stop it. |
void |
forward(int time)
Makes the robot move forwards for the given amount of time |
int |
getSensor1()
Get the current reading of this sensor |
int |
getSensor2()
Get the current reading of this sensor |
int |
getSensor3()
Get the current reading of this sensor |
void |
left()
Sets the robot spinning left, this will continue until some other method is called to stop it. |
void |
left(int time)
Spins the robot left for the given amount of time |
void |
right()
Sets the robot spinning right, this will continue until some other method is called to stop it. |
void |
right(int time)
Spins the robot right for the given amount of time |
void |
run()
|
void |
stopMoving()
Stops all motors immediately |
Field Detail |
public static int MOTOR_POWER
Constructor Detail |
public RealRCX(Controller controller)
controller
- the Controller associated with this RCXMethod Detail |
public void run()
public void forward()
forward
in interface AbstractRobot
public void forward(int time)
forward
in interface AbstractRobot
time
- the time in millisecondspublic void backward()
backward
in interface AbstractRobot
public void backward(int time)
backward
in interface AbstractRobot
time
- the time in millisecondspublic void right()
right
in interface AbstractRobot
public void right(int time)
right
in interface AbstractRobot
time
- the time in millisecondspublic void left()
left
in interface AbstractRobot
public void left(int time)
left
in interface AbstractRobot
time
- the time in millisecondspublic void stopMoving()
stopMoving
in interface AbstractRobot
public void beep()
beep
in interface AbstractRobot
public int getSensor1()
getSensor1
in interface AbstractRobot
public int getSensor2()
getSensor2
in interface AbstractRobot
public int getSensor3()
getSensor3
in interface AbstractRobot
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |