|
|||||||||
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.NXTCam
public class NXTCam
Mindsensors NXTCam.
www.mindsensors.com
Author Lawrie Griffiths
WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS.
DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT.
Field Summary | |
---|---|
static char |
COLOR
Used by sortBy() to choose sorting criteria based on color id (ordered 0 to 7). |
static char |
LINE_TRACKING
Used by setTrackingMode() to choose line tracking. |
static char |
NO_SORTING
Used by sortBy() to choose no sorting of detected objects. |
static char |
OBJECT_TRACKING
Used by setTrackingMode() to choose object tracking. |
static char |
SIZE
Used by sortBy() to choose sorting criteria based on size (ordered largest to smallest). |
Fields inherited from interface lejos.nxt.SensorConstants |
---|
MODE_ANGLESTEP, MODE_BOOLEAN, MODE_CELSIUS, MODE_FARENHEIT, MODE_PCTFULLSCALE, MODE_PERIODCOUNTER, MODE_RAW, MODE_TRANSITIONCNT, TYPE_ANGLE, TYPE_CUSTOM, 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 |
Constructor Summary | |
---|---|
NXTCam(I2CPort port)
|
Method Summary | |
---|---|
void |
enableTracking(boolean enable)
|
int |
getNumberOfObjects()
Get the number of objects being tracked |
int |
getObjectColor(int id)
Get the color number for a tracked object |
Rectangle |
getRectangle(int id)
Get the rectangle containing a tracked object |
void |
sendCommand(char cmd)
Send a single byte command represented by a letter |
void |
setTrackingMode(char mode)
Choose either object or line tracking mode. |
void |
sortBy(char sortType)
Camera sorts objects it detects according to criteria, either color, size, or no sorting at all. |
Methods inherited from class lejos.nxt.I2CSensor |
---|
fetchString, getData, getPort, getProductID, getSensorType, getVersion, sendData, sendData, setAddress |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char SIZE
public static final char COLOR
public static final char NO_SORTING
public static final char OBJECT_TRACKING
public static final char LINE_TRACKING
Constructor Detail |
---|
public NXTCam(I2CPort port)
Method Detail |
---|
public int getNumberOfObjects()
public void sortBy(char sortType)
sortType
- Use the class constants SIZE, COLOR, or NO_SORTING.public void enableTracking(boolean enable)
enable
- true to enable, false to disablepublic void setTrackingMode(char mode)
mode
- Use either OBJECT_TRACKING or LINE_TRACKINGpublic int getObjectColor(int id)
id
- the object number (starting at zero)
public Rectangle getRectangle(int id)
id
- the object number (starting at zero)
public void sendCommand(char cmd)
cmd
- the letter that identifies the command
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |