lejos.nxt.addon
Class NXTLineLeader

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

public class NXTLineLeader
extends I2CSensor

This class manages the sensor NXT Line Leader from Mindsensors. The sensor add a sensor row to detect black/white lines. This sensor is perfect to build a robot which has the mission to follow a line.

Author:
Juan Antonio Brenha Moral

Field Summary
 
Fields inherited from class lejos.nxt.I2CSensor
PRODUCT_ID, SENSOR_TYPE, VERSION
 
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_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
 
Constructor Summary
NXTLineLeader(I2CPort port)
          Constructor
 
Method Summary
 int getAverage()
          Get the average value
 int getKD()
          Get KD value
 int getKI()
          Get KI value
 int getKP()
          Get KP value
 int getResult()
          Get result value
 int getSensorStatus(int index)
          Get status from each sensor in the raw
 int getSteering()
          Get the steering value
 void sendCommand(char cmd)
          Send a single byte command represented by a letter
 void setKD(int KD)
          Set KD value
 void setKI(int KI)
          Set KI value
 void setKP(int KP)
          Set KP value
 void sleep()
          Sleep the sensor
 void wakeUp()
          Wake up the sensor
 
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
 

Constructor Detail

NXTLineLeader

public NXTLineLeader(I2CPort port)
Constructor

Parameters:
port -
Method Detail

sendCommand

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

Parameters:
cmd - the letter that identifies the command

sleep

public void sleep()
Sleep the sensor


wakeUp

public void wakeUp()
Wake up the sensor


getSteering

public int getSteering()
Get the steering value


getAverage

public int getAverage()
Get the average value


getResult

public int getResult()
Get result value


getKP

public int getKP()
Get KP value


setKP

public void setKP(int KP)
Set KP value


getKI

public int getKI()
Get KI value


setKI

public void setKI(int KI)
Set KI value


getKD

public int getKD()
Get KD value


setKD

public void setKD(int KD)
Set KD value


getSensorStatus

public int getSensorStatus(int index)
Get status from each sensor in the raw