|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.I2CSensor lejos.nxt.addon.CruizcoreGyro
public class CruizcoreGyro
This Class manages the Micro Infinity Cruizcore XG1300L
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 | |
---|---|
CruizcoreGyro(I2CPort port)
Instantiates a new Cruizcore Gyro sensor. |
Method Summary | |
---|---|
int[] |
getAccel()
Gets the accel. |
int |
getAccel(int axis)
Gets the acceleration in the specified axis. |
int |
getAngle()
Gets the accumulated angle (heading). |
float |
getAngularVelocity()
Implementor must calculate and return the angular velocity in degrees per second. |
int[] |
getLastAccel()
Gets the last acceleration read from the 3 axes. |
int |
getLastAccel(int axis)
Gets the last accel. |
int |
getLastAngle()
Gets the last angle. |
float |
getLastPitch()
Gets the last pitch. |
int |
getLastRate()
Gets the last rate. |
float |
getLastRoll()
Gets the last roll. |
int |
getRate()
Gets the rate. |
int |
getXAccel()
Measures the x-axis of the accelerometer, in meters/second^2. |
int |
getYAccel()
Measures the y-axis of the accelerometer, in meters/second^2. |
int |
getZAccel()
Measures the z-axis of the accelerometer, in meters/second^2. |
boolean |
readAllData()
Read all data from the sensor and save values in the private properties of the class. |
void |
recalibrateOffset()
Implementor must calculate and set the offset/bias value for use in getAngularVelocity() . |
boolean |
reset()
Resets the accumulated angle (heading). |
boolean |
setAccScale(byte sf)
Sets the acc scale. |
boolean |
setAccScale2G()
Sets the acceleration scale factor to 2G. |
boolean |
setAccScale4G()
Sets the acceleration scale factor to 4G. |
boolean |
setAccScale8G()
Sets the acceleration scale factor to 8G. |
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 CruizcoreGyro(I2CPort port)
port
- the port the sensor is attached toMethod Detail |
---|
public boolean readAllData()
getLastAccel()
and similar methods to retrieve values.
public int[] getLastAccel()
readAllData()
public int getLastAccel(int axis)
readAllData()
axis
- the axis (0 for X, 1 for Y, 2 for Z)
public float getLastPitch()
readAllData()
public float getLastRoll()
readAllData()
public int getLastRate()
readAllData()
public int getLastAngle()
readAllData()
public int[] getAccel()
readAllData()
public int getAccel(int axis)
axis
- the axis (0 for X, 1 for Y, 2 for Z)
public int getAngle()
public int getRate()
public boolean setAccScale(byte sf)
sf
- the scale factor
0 for +/- 2G
1 for +/- 4G
2 for +/- 8g
public boolean setAccScale2G()
public boolean setAccScale4G()
public boolean setAccScale8G()
public boolean reset()
public float getAngularVelocity()
Gyroscope
getAngularVelocity
in interface Gyroscope
public void recalibrateOffset()
Gyroscope
getAngularVelocity()
.
recalibrateOffset
in interface Gyroscope
public int getXAccel()
Accelerometer
getXAccel
in interface Accelerometer
public int getYAccel()
Accelerometer
getYAccel
in interface Accelerometer
public int getZAccel()
Accelerometer
getZAccel
in interface Accelerometer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |