|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlejos.nxt.SensorPort
public class SensorPort
Port class. Contains 4 Port instances.
Usage: Port.S4.readValue();
This version of the SensorPort class supports remote execution.
Field Summary | |
---|---|
static SensorPort |
S1
|
static SensorPort |
S2
|
static SensorPort |
S3
|
static SensorPort |
S4
|
Fields inherited from interface lejos.nxt.I2CPort |
---|
ALWAYS_ACTIVE, LEGO_MODE, STANDARD_MODE |
Method Summary | |
---|---|
void |
activate()
Activate an RCX Light Sensor |
void |
enableColorSensor()
|
int |
getId()
|
int |
getMode()
|
int |
getType()
|
void |
passivate()
Passivate an RCX Light Sensor |
boolean |
readBooleanValue()
Reads the boolean value of the sensor. |
int |
readNormalizedValue()
Reads the normalized value of the sensor. |
int |
readRawValue()
Reads the raw value of the sensor. |
int |
readRawValues(int[] values)
Return a variable number of raw sensor values NOTE: Currently there is no way to return multiple results from a remote sensor, so we return an error. |
int |
readValue()
Returns scaled value, depending on mode of sensor. |
int |
readValues(int[] values)
Return a variable number of sensor values. |
void |
setMode(int mode)
|
void |
setType(int type)
|
void |
setTypeAndMode(int type,
int mode)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static SensorPort S1
public static SensorPort S2
public static SensorPort S3
public static SensorPort S4
Method Detail |
---|
public int getId()
getId
in interface I2CPort
public void setTypeAndMode(int type, int mode)
setTypeAndMode
in interface BasicSensorPort
public void setType(int type)
setType
in interface BasicSensorPort
public void setMode(int mode)
setMode
in interface BasicSensorPort
public int getType()
getType
in interface BasicSensorPort
public int getMode()
getMode
in interface BasicSensorPort
public boolean readBooleanValue()
readBooleanValue
in interface ADSensorPort
public int readRawValue()
readRawValue
in interface ADSensorPort
public int readNormalizedValue()
public int readValue()
readValue
in interface ADSensorPort
setTypeAndMode(int, int)
public void activate()
activate
in interface LegacySensorPort
public void passivate()
passivate
in interface LegacySensorPort
public int readValues(int[] values)
values
- An array in which to return the sensor values.
public int readRawValues(int[] values)
values
- An array in which to return the sensor values.
public void enableColorSensor()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |