public class HiTechnicNxtCompassSensor extends I2cControllerPortDeviceImpl implements CompassSensor, I2cController.I2cPortReadyCallback
CompassSensor.CompassModeHardwareDevice.Manufacturer| Modifier and Type | Field and Description |
|---|---|
static byte |
CALIBRATION |
static byte |
CALIBRATION_FAILURE |
static int |
COMPASS_BUFFER |
static int |
COMPASS_BUFFER_SIZE |
static byte |
DIRECTION_END |
static byte |
DIRECTION_START |
static byte |
HEADING_IN_TWO_DEGREE_INCREMENTS |
static int |
HEADING_WORD_LENGTH |
static I2cAddr |
I2C_ADDRESS |
static double |
INVALID_DIRECTION |
static byte |
MEASUREMENT |
static byte |
MODE_CONTROL_ADDRESS |
static byte |
ONE_DEGREE_HEADING_ADDER |
controller, physicalPort| Constructor and Description |
|---|
HiTechnicNxtCompassSensor(I2cController module,
int physicalPort) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
calibrationFailed()
Check to see whether calibration was successful.
|
void |
close()
Closes this device
|
protected void |
controllerNowArmedOrPretending()
intended as a subclass hook
|
java.lang.String |
getConnectionInfo()
Get connection information about this device in a human readable format
|
java.lang.String |
getDeviceName()
Returns a string suitable for display to the user as to the type of device.
|
double |
getDirection()
Get the current direction, in degrees, in the range [0, 360).
|
HardwareDevice.Manufacturer |
getManufacturer()
Returns an indication of the manufacturer of this device.
|
int |
getVersion()
Version
|
void |
portIsReady(int port) |
void |
resetDeviceConfigurationForOpMode()
Resets the device's configuration to that which is expected at the beginning of an OpMode.
|
void |
setMode(CompassSensor.CompassMode mode)
Change to calibration or measurement mode
|
java.lang.String |
status()
Status of this sensor, in string form
|
java.lang.String |
toString() |
controllerNowDisarmed, finishConstruction, getI2cController, getPort, onModuleStateChangepublic static final I2cAddr I2C_ADDRESS
public static final byte MODE_CONTROL_ADDRESS
public static final byte CALIBRATION
public static final byte MEASUREMENT
public static final byte HEADING_IN_TWO_DEGREE_INCREMENTS
public static final byte ONE_DEGREE_HEADING_ADDER
public static final byte CALIBRATION_FAILURE
public static final byte DIRECTION_START
public static final byte DIRECTION_END
public static final double INVALID_DIRECTION
public static final int HEADING_WORD_LENGTH
public static final int COMPASS_BUFFER
public static final int COMPASS_BUFFER_SIZE
public HiTechnicNxtCompassSensor(I2cController module, int physicalPort)
protected void controllerNowArmedOrPretending()
I2cControllerPortDeviceImplcontrollerNowArmedOrPretending in class I2cControllerPortDeviceImplpublic java.lang.String toString()
toString in class java.lang.Objectpublic double getDirection()
CompassSensorgetDirection in interface CompassSensorpublic java.lang.String status()
CompassSensorstatus in interface CompassSensorpublic void setMode(CompassSensor.CompassMode mode)
CompassSensorsetMode in interface CompassSensorpublic boolean calibrationFailed()
CompassSensorcalibrationFailed in interface CompassSensorpublic void portIsReady(int port)
portIsReady in interface I2cController.I2cPortReadyCallbackpublic HardwareDevice.Manufacturer getManufacturer()
HardwareDevicegetManufacturer in interface HardwareDevicepublic java.lang.String getDeviceName()
HardwareDevicegetDeviceName in interface HardwareDevicepublic java.lang.String getConnectionInfo()
HardwareDevicegetConnectionInfo in interface HardwareDevicepublic int getVersion()
HardwareDevicegetVersion in interface HardwareDevicepublic void resetDeviceConfigurationForOpMode()
HardwareDeviceresetDeviceConfigurationForOpMode in interface HardwareDevicepublic void close()
HardwareDeviceclose in interface HardwareDevice