|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.I2CSensor lejos.nxt.addon.NXTMMX
public class NXTMMX
Supports the Mindsensors NXTMMX motor multiplexor. This device allows you to connect two additional motors to your robot using a sensor port. Multiple NXTMMXs can be chained together when addressed correctly.
Create an instance of this class to pass to the constructor of a MMXRegulatedMotor
or
MMXMotor
instance.
MMXRegulatedMotor
,
MMXMotor
Field Summary | |
---|---|
static int |
DEFAULT_MMX_ADDRESS
|
static int |
MMX_MOTOR_1
NXTMMX Motor 1. |
static int |
MMX_MOTOR_2
NXTMMX Motor 2. |
Fields inherited from class lejos.nxt.I2CSensor |
---|
address, DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION |
Fields inherited from interface lejos.nxt.SensorConstants |
---|
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, GREEN, GREEN_INDEX, MAX_AD_RAW, MAX_TYPE, MIN_TYPE, MODE_ANGLESTEP, MODE_BOOLEAN, MODE_CELSIUS, MODE_FARENHEIT, MODE_PCTFULLSCALE, MODE_PERIODCOUNTER, MODE_RAW, MODE_TRANSITIONCNT, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HISPEED, TYPE_LIGHT_ACTIVE, TYPE_LIGHT_INACTIVE, TYPE_LOWSPEED, TYPE_LOWSPEED_9V, TYPE_NO_SENSOR, TYPE_REFLECTION, TYPE_SOUND_DB, TYPE_SOUND_DBA, TYPE_SWITCH, TYPE_TEMPERATURE, WHITE, YELLOW |
Constructor Summary | |
---|---|
NXTMMX(SensorPort port)
Constructor for the NXTMMX |
|
NXTMMX(SensorPort port,
int address)
Constructor for the NXTMMX |
Method Summary | |
---|---|
void |
fltMotors()
Floats both motors |
float |
getVoltage()
Returns the voltage supplied to the NXTMMX |
boolean |
isAutoStart()
Determines if motors will automatically start or not. |
void |
reset()
resets mux values to default and stops all tasks. |
void |
setAutoStart(boolean autoStart)
Turns autostart on or off. |
void |
startMotors()
Starts both motors at the same time. |
void |
stopMotors()
Stops both motors |
Methods inherited from class lejos.nxt.I2CSensor |
---|
fetchString, getAddress, getData, getData, getData, getId, getProductID, getVendorID, getVersion, sendData, sendData, sendData, setAddress |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_MMX_ADDRESS
public static final int MMX_MOTOR_1
MMXRegulatedMotor
to M1 of the NXTMMX.
MMXRegulatedMotor.MMXRegulatedMotor(lejos.nxt.addon.NXTMMX, int)
,
Constant Field Valuespublic static final int MMX_MOTOR_2
MMXRegulatedMotor
to M2 of the NXTMMX.
MMXRegulatedMotor.MMXRegulatedMotor(lejos.nxt.addon.NXTMMX, int)
,
Constant Field ValuesConstructor Detail |
---|
public NXTMMX(SensorPort port, int address)
port
- - the sensor port its plugged in toaddress
- The I2C address for the deviceSensorPort.S1
,
SensorPort.S2
,
SensorPort.S3
,
SensorPort.S4
public NXTMMX(SensorPort port)
port
- - the port its plugged in toMethod Detail |
---|
public void reset()
public boolean isAutoStart()
true
if onpublic void setAutoStart(boolean autoStart)
Default at instantiation is true
.
autoStart
- true
to enable autoStartpublic void startMotors()
public void fltMotors()
public void stopMotors()
public float getVoltage()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |