public class MindsensorsLineLeader extends I2CSensor
The code for this sensor has not been tested. Please report test results to the leJOS forum.
Supported modes | |||
---|---|---|---|
Mode name | Description | unit(s) | Getter |
Red | Measures the light value when illuminated with a red light source. | N/A, normalized | getRedMode() |
Sensor configuration
The sensor can be calibrated for black and white using the calibrateWhite and calibrateBlack methods.
The sensor can be put in and out of sleep mode (lights off) using the sleep method and wakeUp methods.
See Sensor datasheet
See Sensor Product page
See The
leJOS sensor framework
See leJOS conventions for
SampleProviders
address, DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION, retryCount
currentMode, modes
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, BROWN, GREEN, GREEN_INDEX, MAX_TYPE, MIN_TYPE, MODE_RAW, NXT_ADC_RES, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HIGHSPEED, TYPE_HIGHSPEED_9V, 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 and Description |
---|
MindsensorsLineLeader(I2CPort port)
Constructor
|
MindsensorsLineLeader(I2CPort port,
int address)
Constructor
|
MindsensorsLineLeader(Port port)
Constructor
|
MindsensorsLineLeader(Port port,
int address)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
calibrateBlack() |
void |
calibrateWhite() |
SensorMode |
getRedMode()
Return a sample provider in that measures the light reflection of a surface illuminated with a red led light.
|
protected void |
init() |
void |
sendCommand(char cmd)
Send a single byte command represented by a letter
|
void |
sleep()
Sleep the sensor
|
void |
wakeUp()
Wake up the sensor
|
fetchString, getAddress, getData, getData, getPort, getProductID, getRetryCount, getVendorID, getVersion, sendData, sendData, sendData, setAddress, setRetryCount
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
public MindsensorsLineLeader(I2CPort port, int address)
port
- address
- I2C address for the devicepublic MindsensorsLineLeader(I2CPort port)
port
- public MindsensorsLineLeader(Port port, int address)
port
- address
- I2C address for the devicepublic MindsensorsLineLeader(Port port)
port
- protected void init()
public void sendCommand(char cmd)
cmd
- the command to be sentpublic void sleep()
public void wakeUp()
public void calibrateWhite()
public void calibrateBlack()
public SensorMode getRedMode()