upm
0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
|
API for the HMC5883L 3-Axis Digital Compass. More...
Honeywell HMC5883L is a 3-axis digital compass. Communication with HMC5883L is simple and all done through an I2C interface. Different breakout boards are available. Typically, a 3V supply is all that is needed to power the sensor.
Public Member Functions | |
Hmc5883l (int bus) | |
float | direction () |
float | heading () |
int16_t * | coordinates () |
mraa::Result | update () |
void | set_declination (float dec) |
float | get_declination () |
Hmc5883l | ( | int | bus | ) |
Creates an Hmc5883l object
bus | Number of the used I2C bus |
int16_t * coordinates | ( | void | ) |
Returns a pointer to an int[3] that contains the coordinates as ints
mraa::Result update | ( | void | ) |
Updates the values by reading from I2C
void set_declination | ( | float | dec | ) |
Sets the magnetic declination for better calibration
float get_declination | ( | ) |
Gets the current magnetic declination value