lejos.nxt
Class NXTCam

java.lang.Object
  extended by lejos.nxt.I2CSensor
      extended by lejos.nxt.NXTCam
All Implemented Interfaces:
SensorConstants

public class NXTCam
extends I2CSensor

Mindsensors NXTCam. www.mindsensors.com Author Lawrie Griffiths


Field Summary
 
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
 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
 
Methods inherited from class lejos.nxt.I2CSensor
getData, getPort, getProductID, getSensorType, getVersion, sendData, sendData, setAddress
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Constructor Detail

NXTCam

public NXTCam(I2CPort port)
Method Detail

getNumberOfObjects

public int getNumberOfObjects()
Get the number of objects being tracked

Returns:
number of objects (0 - 8)

getObjectColor

public int getObjectColor(int id)
Get the color number for a tracked object

Parameters:
id - the object number (starting at zero)
Returns:
the color of the object (starting at zero)

getRectangle

public Rectangle getRectangle(int id)
Get the rectangle containing a tracked object

Parameters:
id - the object number (starting at zero)
Returns:
the rectangle

sendCommand

public void sendCommand(char cmd)
Send a single byte command represented by a letter

Parameters:
cmd - the letter that identifies the command