|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--ukcrobots.core.Motor
A delegating wrapper around the OutputDevice class. All methods delegate to the associated device. Multiple motors may be connected to the same device, if required. This class is based on josx.platform.rcx.Motor
| Constructor Summary | |
Motor(char id)
Create a motor. |
|
| Method Summary | |
void |
backward()
Causes the device to rotate backwards. |
void |
flt()
Causes the device to float. |
void |
forward()
Causes the device to rotate forward. |
int |
getPower()
Returns the current device power. |
boolean |
isFloating()
|
boolean |
isMoving()
|
void |
reverse()
Reverses direction of the device. |
void |
setPower(int power)
Sets the device power to a value between 0 and 7. |
void |
stop()
Causes the device to stop, pretty much instantaneously. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait |
| Constructor Detail |
public Motor(char id)
throws NoSuchDeviceException
id - Which output port the motor is attached to.
This should have a value of 'A', 'B', or 'C'.
NoSuchDeviceException - If the value of id is incorrect.| Method Detail |
public void setPower(int power)
public void forward()
public void backward()
public void reverse()
public int getPower()
public boolean isMoving()
public boolean isFloating()
public void stop()
public void flt()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||