|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cork.device.AbstractDevice | +--cork.net.i2c.AbstractI2CDevice | +--cork.module.devantech.CMPS03
Driver for controlling a Devantech CMPS03 compass module. be sure to calibrate the module properly!
Constructor Summary | |
CMPS03()
Constructor for the CMPS03 object |
Method Summary | |
int |
getBearingByte()
Gets the bearing of the compass as a value between 0-255. |
int |
getBearingDegrees()
Gets the bearing of the compass in degrees. |
java.lang.String |
getDeviceDestription()
Gets the deviceDestription attribute of the CMPS03 object |
java.lang.String |
getDeviceName()
Gets the deviceName attribute of the CMPS03 object |
I2CDevice |
getI2CDevice()
Gets the i2CDevice attribute of the CMPS03 object |
int |
getOppositBearingDegrees()
Gets the opposit bearing from the bearing in degrees. |
int |
getSoftwareRevision()
Gets the softwareRevisionNumber attribute of the CMPS03 object |
void |
markCardinalPoint()
Used to calibrate the CMPS03 module. |
Methods inherited from class cork.net.i2c.AbstractI2CDevice |
capture, destroy, getBusMaster, getDeviceAddress, isCaptured, read, release, start, stop, tick, write |
Methods inherited from class cork.device.AbstractDevice |
addEventListener, removeEventListener, sendDeviceEvent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CMPS03()
Method Detail |
public final void markCardinalPoint() throws I2CException
I have no idea what readings you will get if you fail to properly calibrate the compass module. Use a hand compass to line up the CMPS03 exactly . The more accurate you get, the better the reading from the compass (within the limits of its resolution).
I2CException
- Throws ans I2CException if the calibration call
fails for any reason.public final int getSoftwareRevision()
public int getBearingByte() throws I2CException
I2CException
- Description of Exceptionpublic int getBearingDegrees() throws I2CException
I2CException
- Description of Exceptionpublic int getOppositBearingDegrees() throws I2CException
I2CException
- should the compass not be able to get the bearing.public java.lang.String getDeviceName()
public java.lang.String getDeviceDestription()
public I2CDevice getI2CDevice()
getI2CDevice
in class AbstractI2CDevice
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |