hmc5883l: changed to standard heading and added declination

Signed-off-by: Mihai Tudor Panu <mihai.t.panu@intel.com>
This commit is contained in:
Mihai Tudor Panu
2014-11-14 11:34:43 -08:00
parent 03318b3c4d
commit ea7b7a23fa
3 changed files with 48 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
/*
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
* Contributions: Mihai Tudor Panu <mihai.t.panu@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
@@ -78,9 +79,22 @@ public:
*
* @return 0 for success
*/
int update();
mraa_result_t update();
/**
* Sets the magnetic declination for better calibration
*/
void set_declination(float dec);
/**
* Gets the current magnetic declination value
*
* @return magnetic declination as a float
*/
float get_declination();
private:
int m_coor[3];
float m_declination;
uint8_t m_rx_tx_buf[MAX_BUFFER_LENGTH];
mraa_i2c_context m_i2c;
};