Browse Source

hmc5883l: improve documentation and sample

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Brendan Le Foll 10 years ago
parent
commit
0ef50b8be2
4 changed files with 10 additions and 5 deletions
  1. BIN
      docs/images/hmc5883l.jpeg
  2. 2
    2
      examples/CMakeLists.txt
  3. 2
    1
      examples/hmc5883l.cxx
  4. 6
    2
      src/hmc5883l/hmc5883l.h

BIN
docs/images/hmc5883l.jpeg View File


+ 2
- 2
examples/CMakeLists.txt View File

1
-add_executable (compass compass.cxx)
1
+add_executable (hmc5883l-example hmc5883l.cxx)
2
 add_executable (groveled groveled.cxx)
2
 add_executable (groveled groveled.cxx)
3
 add_executable (grovetemp grovetemp.cxx)
3
 add_executable (grovetemp grovetemp.cxx)
4
 add_executable (lcm-lcd lcm-lcd.cxx)
4
 add_executable (lcm-lcd lcm-lcd.cxx)
67
 include_directories (${PROJECT_SOURCE_DIR}/src/th02)
67
 include_directories (${PROJECT_SOURCE_DIR}/src/th02)
68
 include_directories (${PROJECT_SOURCE_DIR}/src/lsm303)
68
 include_directories (${PROJECT_SOURCE_DIR}/src/lsm303)
69
 
69
 
70
-target_link_libraries (compass hmc5883l ${CMAKE_THREAD_LIBS_INIT})
70
+target_link_libraries (hmc5883l-example hmc5883l ${CMAKE_THREAD_LIBS_INIT})
71
 target_link_libraries (groveled grove ${CMAKE_THREAD_LIBS_INIT})
71
 target_link_libraries (groveled grove ${CMAKE_THREAD_LIBS_INIT})
72
 target_link_libraries (grovetemp grove ${CMAKE_THREAD_LIBS_INIT})
72
 target_link_libraries (grovetemp grove ${CMAKE_THREAD_LIBS_INIT})
73
 target_link_libraries (lcm-lcd i2clcd ${CMAKE_THREAD_LIBS_INIT})
73
 target_link_libraries (lcm-lcd i2clcd ${CMAKE_THREAD_LIBS_INIT})

examples/compass.cxx → examples/hmc5883l.cxx View File

27
 int
27
 int
28
 main(int argc, char **argv)
28
 main(int argc, char **argv)
29
 {
29
 {
30
-    // Use i2c device 0 all the time
30
+//! [Interesting]
31
     upm::Hmc5883l* compass = new upm::Hmc5883l(0);
31
     upm::Hmc5883l* compass = new upm::Hmc5883l(0);
32
     fprintf(stdout, "heading: %f\n", compass->heading());
32
     fprintf(stdout, "heading: %f\n", compass->heading());
33
+//! [Interesting]
33
 
34
 
34
     return 0;
35
     return 0;
35
 }
36
 }

+ 6
- 2
src/hmc5883l/hmc5883l.h View File

32
 /**
32
 /**
33
  * @brief C++ API for HMC5883l (3-axis digital compass)
33
  * @brief C++ API for HMC5883l (3-axis digital compass)
34
  *
34
  *
35
- * This file defines the HMC5883l C++ interface for libhmc5883l
35
+ * The Honeywell [HMC5883L]
36
+ * (http://www.adafruit.com/datasheets/HMC5883L_3-Axis_Digital_Compass_IC.pdf)
37
+ * is a 3-axis digital compass. Communication with the HMC5883L is simple and
38
+ * all done through an I2C interface. Different breakout boards are available,
39
+ * typically a 3V supply is all that is needed to power the sensor.
36
  *
40
  *
37
  * @snippet hmc5883l.cxx Interesting
41
  * @snippet hmc5883l.cxx Interesting
38
- *
42
+ * @image html hmc5883l.jpeg
39
  */
43
  */
40
 
44
 
41
 class Hmc5883l {
45
 class Hmc5883l {