Class BO.io.CompassHMC6352
Extends
BO.I2CBase.
Creates an interface to an HMC6352 Digital Compass module.
Use the compass to obtain a heading. You must hold the sensor flat
to obtain the most accurate heading value (just like an analog compass).
The compass is also useful in obtaining a rotation value in relation
to a fixed position. See Breakout/examples/sensors/hmc6352.html and
Breakout/examples/processing_js/compass.html for example applications.
Defined in: CompassHMC6352.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
BO.io.CompassHMC6352(board, address)
HMC6352 digital compass module
|
| Field Attributes | Field Name and Description |
|---|---|
|
[read-only] The heading in degrees.
|
- Fields borrowed from class BO.I2CBase:
- address, board
| Method Attributes | Method Name and Description |
|---|---|
|
Start continuous reading of the sensor
|
|
|
Stop continuous reading of the sensor
|
- Methods borrowed from class BO.I2CBase:
- addEventListener, dispatchEvent, handleI2C, hasEventListener, removeEventListener, sendI2CRequest, update
| Event Attributes | Event Name and Description |
|---|---|
|
The update event is dispatched when the compass heading is updated.
|
Class Detail
BO.io.CompassHMC6352(board, address)
HMC6352 digital compass module
- Parameters:
- {IOBoard} board
- The IOBoard instance
- {Number} address
- The i2c address of the compass module
Field Detail
{Number}
heading
[read-only] The heading in degrees.
Method Detail
startReading()
Start continuous reading of the sensor
stopReading()
Stop continuous reading of the sensor
Event Detail
{BO.io.CompassEvent.UPDATE}
update
The update event is dispatched when the compass heading is updated.
- This event has the following properties:
- {BO.io.CompassHMC6352} target
- A reference to the CompassHMC6352 object.
