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()
Polls the sensor.
|
int |
getColorInt()
Polls the sensor.
|
int |
getLightValue()
Returns the intensity of the detected light.
|
void |
setFloodlight(int colorValue)
Turns the red, green or blue LED on or all off.
|
public NxtColorSensor(SensorPort port)
port
- the port where the sensor is plugged-inpublic NxtColorSensor()
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