Преглед изворни кода

hmc5883l: improve documentation and sample

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Brendan Le Foll пре 10 година
родитељ
комит
0ef50b8be2
4 измењених фајлова са 10 додато и 5 уклоњено
  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 Прегледај датотеку


+ 2
- 2
examples/CMakeLists.txt Прегледај датотеку

@@ -1,4 +1,4 @@
1
-add_executable (compass compass.cxx)
1
+add_executable (hmc5883l-example hmc5883l.cxx)
2 2
 add_executable (groveled groveled.cxx)
3 3
 add_executable (grovetemp grovetemp.cxx)
4 4
 add_executable (lcm-lcd lcm-lcd.cxx)
@@ -67,7 +67,7 @@ include_directories (${PROJECT_SOURCE_DIR}/src/tcs3414cs)
67 67
 include_directories (${PROJECT_SOURCE_DIR}/src/th02)
68 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 71
 target_link_libraries (groveled grove ${CMAKE_THREAD_LIBS_INIT})
72 72
 target_link_libraries (grovetemp grove ${CMAKE_THREAD_LIBS_INIT})
73 73
 target_link_libraries (lcm-lcd i2clcd ${CMAKE_THREAD_LIBS_INIT})

examples/compass.cxx → examples/hmc5883l.cxx Прегледај датотеку

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

+ 6
- 2
src/hmc5883l/hmc5883l.h Прегледај датотеку

@@ -32,10 +32,14 @@ namespace upm {
32 32
 /**
33 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 41
  * @snippet hmc5883l.cxx Interesting
38
- *
42
+ * @image html hmc5883l.jpeg
39 43
  */
40 44
 
41 45
 class Hmc5883l {