mirror of
https://github.com/eclipse/upm.git
synced 2025-03-24 01:10:22 +03:00
hmc5883l: Add comments to C++ example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
This commit is contained in:
parent
fb8dd8ad85
commit
4dc4461004
@ -30,11 +30,13 @@ int
|
|||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
//! [Interesting]
|
//! [Interesting]
|
||||||
|
// Instantiate on I2C
|
||||||
upm::Hmc5883l* compass = new upm::Hmc5883l(0);
|
upm::Hmc5883l* compass = new upm::Hmc5883l(0);
|
||||||
int16_t *pos;
|
int16_t *pos;
|
||||||
|
|
||||||
compass->set_declination(0.2749); // Set your declination from true north in radians
|
compass->set_declination(0.2749); // Set your declination from true north in radians
|
||||||
|
|
||||||
|
// Print out the coordinates, heading, and direction every second
|
||||||
while(true){
|
while(true){
|
||||||
compass->update(); // Update the coordinates
|
compass->update(); // Update the coordinates
|
||||||
pos = compass->coordinates();
|
pos = compass->coordinates();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user