public class NxtLightSensor extends LegoMindstormsNxtSensor implements Deleteable
port
bluetooth, logTag
form
ACCELEROMETER_SENSITIVITY_MODERATE, ACCELEROMETER_SENSITIVITY_STRONG, ACCELEROMETER_SENSITIVITY_WEAK, ALIGNMENT_CENTER, ALIGNMENT_NORMAL, ALIGNMENT_OPPOSITE, ASSET_DIRECTORY, BUTTON_SHAPE_DEFAULT, BUTTON_SHAPE_OVAL, BUTTON_SHAPE_RECT, BUTTON_SHAPE_ROUNDED, COLOR_BLACK, COLOR_BLUE, COLOR_CYAN, COLOR_DEFAULT, COLOR_DKGRAY, COLOR_GRAY, COLOR_GREEN, COLOR_LTGRAY, COLOR_MAGENTA, COLOR_NONE, COLOR_ORANGE, COLOR_PINK, COLOR_RED, COLOR_WHITE, COLOR_YELLOW, DEFAULT_VALUE_COLOR_BLACK, DEFAULT_VALUE_COLOR_BLUE, DEFAULT_VALUE_COLOR_CYAN, DEFAULT_VALUE_COLOR_DEFAULT, DEFAULT_VALUE_COLOR_DKGRAY, DEFAULT_VALUE_COLOR_GRAY, DEFAULT_VALUE_COLOR_GREEN, DEFAULT_VALUE_COLOR_LTGRAY, DEFAULT_VALUE_COLOR_MAGENTA, DEFAULT_VALUE_COLOR_NONE, DEFAULT_VALUE_COLOR_ORANGE, DEFAULT_VALUE_COLOR_PINK, DEFAULT_VALUE_COLOR_RED, DEFAULT_VALUE_COLOR_WHITE, DEFAULT_VALUE_COLOR_YELLOW, DIRECTION_EAST, DIRECTION_MAX, DIRECTION_MIN, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_NORTHEAST, DIRECTION_NORTHWEST, DIRECTION_SOUTH, DIRECTION_SOUTHEAST, DIRECTION_SOUTHWEST, DIRECTION_WEST, FONT_DEFAULT_SIZE, LAYOUT_ORIENTATION_HORIZONTAL, LAYOUT_ORIENTATION_VERTICAL, LENGTH_FILL_PARENT, LENGTH_PREFERRED, LENGTH_UNKNOWN, SLIDER_MAX_VALUE, SLIDER_MIN_VALUE, SLIDER_THUMB_VALUE, TOAST_LENGTH_LONG, TOAST_LENGTH_SHORT, TYPEFACE_DEFAULT, TYPEFACE_MONOSPACE, TYPEFACE_SANSSERIF, TYPEFACE_SERIF
Constructor and Description |
---|
NxtLightSensor(ComponentContainer container)
Creates a new NxtLightSensor component.
|
Modifier and Type | Method and Description |
---|---|
void |
AboveRange() |
boolean |
AboveRangeEventEnabled()
Returns whether the AboveRange event should fire when the light level
goes above the TopOfRange.
|
void |
AboveRangeEventEnabled(boolean enabled)
Specifies whether the AboveRange event should fire when the light level
goes above the TopOfRange.
|
void |
BelowRange() |
boolean |
BelowRangeEventEnabled()
Returns whether the BelowRange event should fire when the light level
goes below the BottomOfRange.
|
void |
BelowRangeEventEnabled(boolean enabled)
Specifies whether the BelowRange event should fire when the light level
goes below the BottomOfRange.
|
int |
BottomOfRange()
Returns the bottom of the range used for the BelowRange, WithinRange,
and AboveRange events.
|
void |
BottomOfRange(int bottomOfRange)
Specifies the bottom of the range used for the BelowRange, WithinRange,
and AboveRange events.
|
boolean |
GenerateLight()
Returns whether the light sensor should generate light.
|
void |
GenerateLight(boolean generateLight)
Specifies whether the light sensor should generate light.
|
int |
GetLightLevel() |
protected void |
initializeSensor(java.lang.String functionName) |
void |
onDelete() |
void |
SensorPort(java.lang.String sensorPortLetter)
Specifies the sensor port that the sensor is connected to.
|
int |
TopOfRange()
Returns the top of the range used for the BelowRange, WithinRange, and
AboveRange events.
|
void |
TopOfRange(int topOfRange)
Specifies the top of the range used for the BelowRange, WithinRange, and
AboveRange events.
|
void |
WithinRange() |
boolean |
WithinRangeEventEnabled()
Returns whether the WithinRange event should fire when the light level
goes between the BottomOfRange and the TopOfRange.
|
void |
WithinRangeEventEnabled(boolean enabled)
Specifies whether the WithinRange event should fire when the light level
goes between the BottomOfRange and the TopOfRange.
|
afterConnect, SensorPort, setSensorPort
beforeDisconnect, BluetoothClient, BluetoothClient, checkBluetooth, convertMotorPortLetterToNumber, convertMotorPortLetterToNumber, convertSensorPortLetterToNumber, convertSensorPortLetterToNumber, copyBooleanValueToBytes, copySBYTEValueToBytes, copySLONGValueToBytes, copyStringValueToBytes, copySWORDValueToBytes, copyUBYTEValueToBytes, copyULONGValueToBytes, copyUWORDValueToBytes, evaluateStatus, getBooleanValueFromBytes, getInputValues, getSBYTEValueFromBytes, getSLONGValueFromBytes, getStatus, getStringValueFromBytes, getStringValueFromBytes, getSWORDValueFromBytes, getUBYTEValueFromBytes, getULONGValueFromBytes, getUWORDValueFromBytes, Initialize, lsGetStatus, lsRead, lsWrite, resetInputScaledValue, sanitizePower, sanitizeTurnRatio, sendCommand, sendCommandAndReceiveReturnPackage, setInputMode, setOutputState
getDispatchDelegate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDispatchDelegate
public NxtLightSensor(ComponentContainer container)
protected void initializeSensor(java.lang.String functionName)
initializeSensor
in class LegoMindstormsNxtSensor
public void SensorPort(java.lang.String sensorPortLetter)
SensorPort
in class LegoMindstormsNxtSensor
public boolean GenerateLight()
public void GenerateLight(boolean generateLight)
public int GetLightLevel()
public int BottomOfRange()
public void BottomOfRange(int bottomOfRange)
public int TopOfRange()
public void TopOfRange(int topOfRange)
public boolean BelowRangeEventEnabled()
public void BelowRangeEventEnabled(boolean enabled)
public void BelowRange()
public boolean WithinRangeEventEnabled()
public void WithinRangeEventEnabled(boolean enabled)
public void WithinRange()
public boolean AboveRangeEventEnabled()
public void AboveRangeEventEnabled(boolean enabled)
public void AboveRange()
public void onDelete()
onDelete
in interface Deleteable
onDelete
in class LegoMindstormsNxtBase