|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectjBotBrain.hw.Motor
public class Motor
Motor abstraction class. Usage:
Motor.A.setSpeed(200);
Motor.A.setDirection(Motor.MOTOR_FORWARD);
Motor.B.setSpeed(50);
Motor.B.setDirection(Motor.MOTOR_BACKWARD);
| Field Summary | |
|---|---|
static Motor |
A
1st motor |
static Motor |
B
2nd motor |
static int |
MOTOR_BACKWARD
Backward direction |
static int |
MOTOR_FORWARD
Forward direction |
| Method Summary | |
|---|---|
int |
getMotorCurrent()
Get motor current |
void |
setDirection(int direction)
Set movement direction of motor |
void |
setSpeed(int speed)
Set motor speed |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait |
| Field Detail |
|---|
public static final Motor A
public static final Motor B
public static final int MOTOR_FORWARD
public static final int MOTOR_BACKWARD
| Method Detail |
|---|
public void setSpeed(int speed)
speed - - Motor speed in range from 0 to 255public void setDirection(int direction)
time - - Motor directionMOTOR_FORWARD,
MOTOR_BACKWARDpublic int getMotorCurrent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||