public class CruizcoreGyro extends I2CSensor
The code for this sensor has not been tested. Please report test results to the leJOS forum.
Supported modes | |||
---|---|---|---|
Mode name | Description | unit(s) | Getter |
Acceleration | Measures linear acceleration over three axes | getAccelerationMode() |
|
Rate | Measures rate of turn over the Z-axis | getRateMode() |
|
Measures angle over the Z-axis | getAngleMode() |
See
Sensor datasheet
See
Sensor Product page
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 |
---|
CruizcoreGyro(I2CPort port)
Instantiates a new Cruizcore Gyro sensor.
|
CruizcoreGyro(Port port) |
Modifier and Type | Method and Description |
---|---|
SensorMode |
getAccelerationMode()
Cruizcore XG1300L, Acceleration mode
Measures linear acceleration over three axes |
SensorMode |
getAngleMode()
Cruizcore XG1300L, Angle mode
Measures angle over the Z-axis |
SensorMode |
getRateMode()
Cruizcore XG1300L, Acceleration mode
Measures rate of turn over the Z-axis |
protected void |
init() |
void |
reset()
Resets the accumulated angle (heading).
|
void |
setAccScale(int sf)
Sets the acc scale.
|
void |
setAccScale2G()
Sets the acceleration scale factor to 2G.
|
void |
setAccScale4G()
Sets the acceleration scale factor to 4G.
|
void |
setAccScale8G()
Sets the acceleration scale factor to 8G.
|
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 CruizcoreGyro(I2CPort port)
port
- the port the sensor is attached topublic CruizcoreGyro(Port port)
protected void init()
public void setAccScale(int sf)
sf
- the scale factor: 0 for +/- 2G, 1 for +/- 4G, 2 for +/- 8gjava.lang.IllegalArgumentException
- if the parameter is neither 0, 1, or 2.public void setAccScale2G()
public void setAccScale4G()
public void setAccScale8G()
public void reset()
public SensorMode getAccelerationMode()
Size and content of the sample
The sample contains 3 elements. Each element gives linear acceleration
(in metres/second^2). Axis order in sample is X, Y, Z.
Configuration
The sensor can be configured for range using the setAccScale#G() methods
of the sensor class.
leJOS conventions for
SampleProviders
See
Sensor datasheet public SensorMode getRateMode()
Size and content of the sample
The sample contains one element, the rate of turn (in degrees / second)
over the Z-axis.
Configuration
There are no configurable parameters.
leJOS conventions for
SampleProviders
See
Sensor datasheet public SensorMode getAngleMode()
Size and content of the sample
The sample contains one element, the accumulated angle (in degrees). .
Configuration
The accumulated angle can be reset to zero using the reset() method of
the sensor class.
leJOS conventions for
SampleProviders
See
Sensor datasheet