Package lejos.hardware.sensor
Class DexterIMUSensor.DexterIMUAccelerationSensor
- java.lang.Object
-
- lejos.hardware.Device
-
- lejos.hardware.sensor.BaseSensor
-
- lejos.hardware.sensor.I2CSensor
-
- lejos.hardware.sensor.DexterIMUSensor.DexterIMUAccelerationSensor
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,SensorConstants,SensorMode,SensorModes,SampleProvider
- Enclosing class:
- DexterIMUSensor
public class DexterIMUSensor.DexterIMUAccelerationSensor extends I2CSensor implements SampleProvider, SensorMode
Class to access the Acceleration sensor from Dexter Industries IMU the acceleration sensor is the Freescale MMA7455- Author:
- Aswin
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDATA_10BIT_REGprotected static intDATA_8BIT_REGprotected static intMODE_REGprotected static floatTOSI-
Fields inherited from class lejos.hardware.sensor.I2CSensor
address, DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION, retryCount
-
Fields inherited from class lejos.hardware.sensor.BaseSensor
currentMode, modes
-
Fields inherited from interface lejos.hardware.sensor.SensorConstants
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, BROWN, GREEN, GREEN_INDEX, MAX_TYPE, MIN_TYPE, MODE_RAW, NXT_ADC_RES, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HIGHSPEED, TYPE_HIGHSPEED_9V, 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfetchSample(float[] sample, int offset)Fetches a sample from a sensor or filter.java.lang.StringgetName()return a string description of this sensor modeintsampleSize()Returns the number of elements in a sample.
The number of elements does not change during runtime.-
Methods inherited from class lejos.hardware.sensor.I2CSensor
fetchString, getAddress, getData, getData, getPort, getProductID, getRetryCount, getVendorID, getVersion, sendData, sendData, sendData, setAddress, setRetryCount
-
Methods inherited from class lejos.hardware.sensor.BaseSensor
getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, setCurrentMode, setCurrentMode, setModes
-
Methods inherited from class lejos.hardware.Device
close, releaseOnClose
-
-
-
-
Field Detail
-
DATA_10BIT_REG
protected static final int DATA_10BIT_REG
- See Also:
- Constant Field Values
-
DATA_8BIT_REG
protected static final int DATA_8BIT_REG
- See Also:
- Constant Field Values
-
MODE_REG
protected static final int MODE_REG
- See Also:
- Constant Field Values
-
TOSI
protected static final float TOSI
- See Also:
- Constant Field Values
-
-
Method Detail
-
sampleSize
public int sampleSize()
Description copied from interface:SampleProviderReturns the number of elements in a sample.
The number of elements does not change during runtime.- Specified by:
sampleSizein interfaceSampleProvider- Overrides:
sampleSizein classBaseSensor- Returns:
- the number of elements in a sample
-
getName
public java.lang.String getName()
Description copied from interface:SensorModereturn a string description of this sensor mode- Specified by:
getNamein interfaceSensorMode- Overrides:
getNamein classBaseSensor- Returns:
- The description/name of this mode
-
fetchSample
public void fetchSample(float[] sample, int offset)Description copied from interface:SampleProviderFetches a sample from a sensor or filter.- Specified by:
fetchSamplein interfaceSampleProvider- Overrides:
fetchSamplein classBaseSensor- Parameters:
sample- The array to store the sample in.offset- The elements of the sample are stored in the array starting at the offset position.
-
-