|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pt.citar.diablu.nxt.protocol.NXTCommand pt.citar.diablu.nxt.protocol.NXTCommandSetOutputState
public class NXTCommandSetOutputState
This command allows you to set the output state, i.e., to control the NXT motors.
Field Summary | |
---|---|
static byte |
MODE_BRAKE
The brake mode (bit field - can be combined with other modes). |
static byte |
MODE_MOTOR_ON
The motor on mode (bit field - can be combined with other modes). |
static byte |
MODE_REGULATED
The regulated mode (bit field - can be combined with other modes). |
static byte |
REGULATION_MODE_IDLE
The idle regulation mode mode. |
static byte |
REGULATION_MODE_MOTOR_SPEED
The motor speed regulation mode mode. |
static byte |
REGULATION_MODE_MOTOR_SYNC
The motor sync regulation mode mode. |
static byte |
RUN_STATE_IDLE
The idle run state. |
static byte |
RUN_STATE_RAMP_DOWN
The ramp down run state. |
static byte |
RUN_STATE_RAMP_UP
The ramp up run state. |
static byte |
RUN_STATE_RUNNING
The running run state. |
Constructor Summary | |
---|---|
NXTCommandSetOutputState()
Creates a new instance of NXTCommandSetOutputState |
|
NXTCommandSetOutputState(byte outputPort,
byte powerSetPoint,
byte modeByte,
byte regulationMode,
byte turnRatio,
byte runState,
long tachoLimit)
Constructs a new NXTCommandSetOutputState object with output port, power set point,
mode byte, regulation mode, turn ration, run state and tacho limit and with no response requirement. |
Method Summary | |
---|---|
byte |
getMode()
|
byte |
getPowerSetPoint()
|
byte |
getRunState()
|
long |
getTachoLimit()
TODO: Check. |
void |
setMode(byte mode)
Sets the mode. |
void |
setPowerSetPoint(byte power)
Sets the power set point. |
void |
setRegulationMode(byte regulationMode)
Sets the regulation mode of the motor. |
void |
setRunState(byte runState)
Sets the run state of the motor. |
void |
setTachoLimit(long tachoLimit)
Sets the tacho limit. |
Methods inherited from class pt.citar.diablu.nxt.protocol.NXTCommand |
---|
getPacketLength, isResponseRequired, sendCommand, setResponseRequired, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte MODE_MOTOR_ON
public static final byte MODE_BRAKE
public static final byte MODE_REGULATED
public static final byte REGULATION_MODE_IDLE
public static final byte REGULATION_MODE_MOTOR_SPEED
public static final byte REGULATION_MODE_MOTOR_SYNC
public static final byte RUN_STATE_IDLE
public static final byte RUN_STATE_RAMP_UP
public static final byte RUN_STATE_RUNNING
public static final byte RUN_STATE_RAMP_DOWN
Constructor Detail |
---|
public NXTCommandSetOutputState()
public NXTCommandSetOutputState(byte outputPort, byte powerSetPoint, byte modeByte, byte regulationMode, byte turnRatio, byte runState, long tachoLimit)
NXTCommandSetOutputState
object with output port, power set point,
mode byte, regulation mode, turn ration, run state and tacho limit and with no response requirement.
outputPort
- The output port on which the motor is connected. Range: 0 - 2; 0xff is a special value
that means ALL.powerSetPoint
- The power set point (-100 to 100).modeByte
- The mode byte (bit field). See MODE constants.regulationMode
- The regulation mode. See REGULATION_MODE constants.turnRatio
- The turn ratio (-100 to 100).runState
- The run state. See RUN_STATE constants.tachoLimit
- The tacho limit. 0 means forever.Method Detail |
---|
public void setPowerSetPoint(byte power)
power
- The power set point. Range: -100; 100.public byte getPowerSetPoint()
public void setRunState(byte runState)
runState
- The run state. See RUN_STATE constants.public byte getRunState()
public void setRegulationMode(byte regulationMode)
regulationMode
- The regulation mode. See REGULATION_MODE constants.public void setMode(byte mode)
mode
- The mode. See MODE constants.public byte getMode()
public void setTachoLimit(long tachoLimit)
tachoLimit
- The tacho limit to set.public long getTachoLimit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |