|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.I2CSensor lejos.nxt.addon.ColorHTSensor
public class ColorHTSensor
HiTechnic color sensor.
www.hitechnic.com
This class does support HiTechnic Color Sensor V2.
Field Summary |
---|
Fields inherited from class lejos.nxt.I2CSensor |
---|
address, DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION |
Fields inherited from interface lejos.nxt.SensorConstants |
---|
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, GREEN, GREEN_INDEX, MAX_AD_RAW, MAX_TYPE, MIN_TYPE, MODE_ANGLESTEP, MODE_BOOLEAN, MODE_CELSIUS, MODE_FARENHEIT, MODE_PCTFULLSCALE, MODE_PERIODCOUNTER, MODE_RAW, MODE_TRANSITIONCNT, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, 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 Summary | |
---|---|
ColorHTSensor(I2CPort port)
|
Method Summary | |
---|---|
Color |
getColor()
Return the Red, Green and Blue values together in one object. |
int |
getColorID()
Returns the color index detected by the sensor. |
int |
getColorIndexNumber()
Essentially the same as getColorNumber() but with a resolution of 6 bits. |
int |
getMode()
Returns the value of the mode control register (0x41) |
int |
getRGBComponent(int color)
Returns a single color component, specified by using an enumeration constant as a parameter. |
int |
getRGBNormalized(int color)
Returns the normalized color component. |
int |
getRGBRaw(int color)
Returns the raw saturation of the color. |
int |
initBlackLevel()
Puts the sensor into black/ambient level calibration mode. |
int |
initWhiteBalance()
Puts the sensor into white balance calibration mode. |
Methods inherited from class lejos.nxt.I2CSensor |
---|
fetchString, getAddress, getData, getData, getPort, getProductID, getVendorID, getVersion, sendData, sendData, sendData, setAddress |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorHTSensor(I2CPort port)
Method Detail |
---|
public int getColorID()
getColorID
in interface ColorDetector
public int getColorIndexNumber()
public int getRGBComponent(int color)
color
- An integer obtained from Color, such as Color.RED, Color.GREEN or Color.BLUE
public int getRGBNormalized(int color)
public int getRGBRaw(int color)
public int getMode()
public int initWhiteBalance()
public int initBlackLevel()
public Color getColor()
ColorDetector
getColor
in interface ColorDetector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |