public class HiTechnicAccelerometer extends I2CSensor
Supported modes | |||
---|---|---|---|
Mode name | Description | unit(s) | Getter |
Acceleration | Measures acceleration over three axes. | meter / second2 | getAccelerationMode() |
See
Sensor Product page (Some details from HTAC-driver.h from
http://botbench.com/blog/robotc-driver-suite/)
See The
leJOS sensor framework
See leJOS conventions for
SampleProviders
address, DEFAULT_I2C_ADDRESS, port, REG_PRODUCT_ID, REG_VENDOR_ID, REG_VERSION, retryCount
currentMode, modes
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
Constructor and Description |
---|
HiTechnicAccelerometer(I2CPort port)
Creates a SampleProvider for the HiTechnic Acceleration Sensor
|
HiTechnicAccelerometer(I2CPort port,
int address)
Creates a SampleProvider for the HiTechnic Acceleration Sensor
|
HiTechnicAccelerometer(Port port)
Creates a SampleProvider for the HiTechnic Acceleration Sensor
|
HiTechnicAccelerometer(Port port,
int address)
Creates a SampleProvider for the HiTechnic Acceleration Sensor
|
Modifier and Type | Method and Description |
---|---|
SensorMode |
getAccelerationMode()
HiTechnic NXT Acceleration , Acceleration mode
Measures acceleration over three axes. |
protected void |
init() |
fetchString, getAddress, getData, getData, getPort, getProductID, getRetryCount, getVendorID, getVersion, sendData, sendData, sendData, setAddress, setRetryCount
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
public HiTechnicAccelerometer(I2CPort port, int address)
port
- the I2C portaddress
- the I2C address of the sensorpublic HiTechnicAccelerometer(I2CPort port)
port
- the I2C portpublic HiTechnicAccelerometer(Port port, int address)
port
- the sensor portaddress
- the I2C address of the sensorpublic HiTechnicAccelerometer(Port port)
port
- the I2C portprotected void init()
public SensorMode getAccelerationMode()
Size and content of the sample
The sample contains 3 elements, containing acceleration over the X, Y and Z
axis respectively. The range of the sensor is -2 to 2 G (1G = 9.81
m/s2).
leJOS conventions for
SampleProviders
See
Sensor datasheet