public class NxtColorSensor extends Sensor
Constructor and Description |
---|
NxtColorSensor()
Creates a sensor instance connected to port S1.
|
NxtColorSensor(SensorPort port)
Creates a sensor instance connected to the given port.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getColor()
Returns a java.awt.Color reference to the color reading.
|
int |
getColorInt()
Returns the color as integer value of the color reading.
|
lejos.hardware.sensor.NXTColorSensor |
getLejosSensor()
Returns the reference of the the underlying
lejos.hardware.sensor.NxtColorSensor.
|
int |
getLightValue()
Returns the intensity of the detected light.
|
void |
setFloodlight(int colorValue)
Turns the red, green or blue LED on or all off.
|
getLejosPort
public NxtColorSensor(SensorPort port)
port
- the port where the sensor is plugged-inpublic NxtColorSensor()
public lejos.hardware.sensor.NXTColorSensor getLejosSensor()
public java.awt.Color getColor()
public int getColorInt()
public int getLightValue()
public void setFloodlight(int colorValue)
colorValue
- 0: red, 1: green, 2: blue, -1: all off