mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +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)
|
||||
{
|
||||
//! [Interesting]
|
||||
// Instantiate on I2C
|
||||
upm::Hmc5883l* compass = new upm::Hmc5883l(0);
|
||||
int16_t *pos;
|
||||
|
||||
compass->set_declination(0.2749); // Set your declination from true north in radians
|
||||
|
||||
// Print out the coordinates, heading, and direction every second
|
||||
while(true){
|
||||
compass->update(); // Update the coordinates
|
||||
pos = compass->coordinates();
|
||||
|
Loading…
x
Reference in New Issue
Block a user