|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlejos.nxt.I2CSensor
lejos.nxt.addon.CompassHTSensor
public class CompassHTSensor
This class supports the HiTechnic compass sensor.
| 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 | |
|---|---|
CompassHTSensor(I2CPort port)
Create a compass sensor object |
|
CompassHTSensor(I2CPort port,
int address)
Create a compass sensor object |
|
| Method Summary | |
|---|---|
float |
getDegrees()
Returns the directional heading in degrees. |
float |
getDegreesCartesian()
Cartesian coordinate systems increase from 0 to 360 counter-clockwise, but Compass readings increase clockwise . |
void |
resetCartesianZero()
Changes the current direction the compass is facing into the zero angle for the method getDegreesCartesian(). |
void |
startCalibration()
Starts calibration for the compass. |
void |
stopCalibration()
Ends calibration sequence. |
| Methods inherited from class lejos.nxt.I2CSensor |
|---|
fetchString, getAddress, getData, getData, getData, getId, 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 CompassHTSensor(I2CPort port,
int address)
port - Sensor port for the compassaddress - The I2C address used by the sensorpublic CompassHTSensor(I2CPort port)
port - Sensor port for the compass| Method Detail |
|---|
public float getDegrees()
public float getDegreesCartesian()
getDegreesCartesian in interface DirectionFinderpublic void resetCartesianZero()
resetCartesianZero in interface DirectionFinderpublic void startCalibration()
startCalibration in interface DirectionFinderpublic void stopCalibration()
stopCalibration in interface DirectionFinder
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||