|
|||||||||
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.OpticalDistanceSensor
public class OpticalDistanceSensor
Supports Mindsensors DIST-Nx series of Optical Distance Sensor.
This sensor is used for greater precision than the Ultrasonic Sensor.
Field Summary | |
---|---|
static byte |
CUSTOM
Custom sensor |
static byte |
GP2D12
|
static byte |
GP2D120
DIST-Nx-Short |
static byte |
GP2YA02
DIST-Nx-Long |
static byte |
GP2YA21
DIST-Nx-Medium |
Fields inherited from class lejos.nxt.I2CSensor |
---|
PRODUCT_ID, SENSOR_TYPE, VERSION |
Constructor Summary | |
---|---|
OpticalDistanceSensor(I2CPort port)
|
Method Summary | |
---|---|
int |
getCurveCount()
Gets the number of points that will be in the curve. |
int |
getDistance()
Returns the distance from the object in millimeters. |
int |
getDistLSB()
Returns the current distance in millimeters for the LSB. |
int |
getDistMaxLSB()
Gets the max value in millimeters for the LSB. Used for recalibrating the sensor. |
int |
getDistMaxMSB()
Gets the max value in millimeters for the MSB. Used for recalibrating the sensor. |
int |
getDistMinLSB()
Gets the min value in millimeters for the LSB. Used for recalibrating the sensor. |
int |
getDistMinMSB()
Gets the min value in millimeters for the MSB. Used for recalibrating the sensor. |
int |
getDistMSB()
Returns the current distance in millimeters for MSB. |
int |
getDistPointLSB(int index)
Gets millimeter value of the specific index for the LSB. Used for recalibrating the sensor. |
int |
getDistPointMSB(int index)
Gets millimeter value of the specific index for the MSB. |
int |
getSensorModule()
Used to determin the sensore module that is configured. |
int |
getVoltLSB()
Returns the current voltage level in millivolts for the LSB. |
int |
getVoltMSB()
Returns the current voltage level in millivolts for the MSB. |
int |
getVoltPointLSB(int index)
Gets millivolts value of the specific index for the LSB. |
int |
getVoltPointMSB(int index)
Gets millivolts value of the specific index for the MSB. |
void |
powerOff()
Turns power to the sensor module off. |
void |
powerOn()
Turns the sensor module on. |
void |
setAPDAOff()
Disables (ADPA) Auto Detecting Parallel Architecture. Disabled by default. |
void |
setAPDAOn()
Enables (ADPA) Auto Detecting Parallel Architecture. |
void |
setCurveCount(int value)
Sets the number of points that will be in the configured curve. |
void |
setDistMaxLSB(int value)
Sets the max value in millimeters for LSB. Used for recalibrating the sensor. |
void |
setDistMaxMSB(int value)
Sets the max value in millimeters for the MSB. Used for recalibrating the sensor. |
void |
setDistMinLSB(int value)
Sets the min value in millimeters for the LSB. Used for recalibrating the sensor. |
void |
setDistMinMSB(int value)
Sets the min value in millimeters for the MSB. Used for recalibrating the sensor. |
void |
setDistPointLSB(int index,
int value)
Sets millimeter value of the specific index for the LSB. |
void |
setDistPointMSB(int index,
int value)
Sets millimeter value of the specific index for the MSB. |
void |
setSensorModule(byte module)
This only needs the be run if you are changing the sensor. |
void |
setVoltPointLSB(int index,
int value)
Sets millivolts value of the specific index for the LSB. |
void |
setVoltPointMSB(int index,
int value)
Sets millivolts value of the specific index for the MSB. |
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 byte GP2D12
public static final byte GP2D120
public static final byte GP2YA21
public static final byte GP2YA02
public static final byte CUSTOM
Constructor Detail |
---|
public OpticalDistanceSensor(I2CPort port)
port
- NXT sensor port 1-4Method Detail |
---|
public void setSensorModule(byte module)
module
- changes the sensor module attached the he board.public int getDistance()
public void powerOn()
public void powerOff()
public void setAPDAOn()
public void setAPDAOff()
public int getDistLSB()
public int getDistMSB()
public int getVoltLSB()
public int getVoltMSB()
public int getSensorModule()
public int getCurveCount()
public void setCurveCount(int value)
value
- max 39public int getDistMinLSB()
public void setDistMinLSB(int value)
value
- intpublic int getDistMinMSB()
public void setDistMinMSB(int value)
value
- intpublic int getDistMaxLSB()
public void setDistMaxLSB(int value)
value
- intpublic int getDistMaxMSB()
public void setDistMaxMSB(int value)
value
- intpublic int getVoltPointLSB(int index)
index
- max 39
public void setVoltPointLSB(int index, int value)
index
- max 39value
- intpublic int getVoltPointMSB(int index)
index
- max 39
public void setVoltPointMSB(int index, int value)
index
- max 39value
- intpublic int getDistPointLSB(int index)
index
- max 39
public void setDistPointLSB(int index, int value)
index
- max 39value
- intpublic int getDistPointMSB(int index)
index
- max 39
public void setDistPointMSB(int index, int value)
index
- max 39.value
- int
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |