|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlejos.nxt.I2CSensor
lejos.nxt.addon.AccelMindSensor
public class AccelMindSensor
This class works with the Mindsensors acceleration (tilt) sensor ACCL-Nx-v2/v3. TODO there are a lot of features not supported by this class
| Field Summary | |
|---|---|
static int |
ERROR
|
| 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 | |
|---|---|
AccelMindSensor(I2CPort port)
|
|
AccelMindSensor(I2CPort port,
int address)
|
|
| Method Summary | |
|---|---|
boolean |
getAllAccel(int[] dst,
int off)
Reads all 3 acceleration values into the given array. |
boolean |
getAllTilt(int[] dst,
int off)
Reads all 3 tilt values into the given array. |
int |
getXAccel()
Acceleration along X axis. |
int |
getXTilt()
Tilt of sensor along X-axis (see top of Mindsensors.com sensor for diagram of axis). |
int |
getYAccel()
Acceleration along Y axis. |
int |
getYTilt()
Returns Y tilt value (see top of Mindsensors.com sensor for diagram of axis). |
int |
getZAccel()
Acceleration along Z axis. |
int |
getZTilt()
Returns Z tilt value (see top of Mindsensors.com sensor for diagram of axis). |
| Methods inherited from class lejos.nxt.I2CSensor |
|---|
fetchString, getAddress, getData, getData, getPort, 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 |
| Field Detail |
|---|
public static final int ERROR
| Constructor Detail |
|---|
public AccelMindSensor(I2CPort port)
public AccelMindSensor(I2CPort port,
int address)
| Method Detail |
|---|
public int getXTilt()
ERROR if call failedpublic int getYTilt()
ERROR if call failedpublic int getZTilt()
ERROR if call failedpublic int getXAccel()
getXAccel in interface AccelerometerERROR.public int getYAccel()
getYAccel in interface AccelerometerERROR.public int getZAccel()
getZAccel in interface AccelerometerERROR.
public boolean getAllTilt(int[] dst,
int off)
dst - destination array.off - offset
public boolean getAllAccel(int[] dst,
int off)
dst - destination array.off - offset
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||