diff --git a/docs/images/hmc5883l.jpeg b/docs/images/hmc5883l.jpeg new file mode 100644 index 00000000..948a4a53 Binary files /dev/null and b/docs/images/hmc5883l.jpeg differ diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 4b720c80..53ccd03f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -add_executable (compass compass.cxx) +add_executable (hmc5883l-example hmc5883l.cxx) add_executable (groveled groveled.cxx) add_executable (grovetemp grovetemp.cxx) add_executable (lcm-lcd lcm-lcd.cxx) @@ -67,7 +67,7 @@ include_directories (${PROJECT_SOURCE_DIR}/src/tcs3414cs) include_directories (${PROJECT_SOURCE_DIR}/src/th02) include_directories (${PROJECT_SOURCE_DIR}/src/lsm303) -target_link_libraries (compass hmc5883l ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries (hmc5883l-example hmc5883l ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries (groveled grove ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries (grovetemp grove ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries (lcm-lcd i2clcd ${CMAKE_THREAD_LIBS_INIT}) diff --git a/examples/compass.cxx b/examples/hmc5883l.cxx similarity index 97% rename from examples/compass.cxx rename to examples/hmc5883l.cxx index 45aaa5e4..7ef3c343 100644 --- a/examples/compass.cxx +++ b/examples/hmc5883l.cxx @@ -27,9 +27,10 @@ int main(int argc, char **argv) { - // Use i2c device 0 all the time +//! [Interesting] upm::Hmc5883l* compass = new upm::Hmc5883l(0); fprintf(stdout, "heading: %f\n", compass->heading()); +//! [Interesting] return 0; } diff --git a/src/hmc5883l/hmc5883l.h b/src/hmc5883l/hmc5883l.h index 84560994..08295b74 100644 --- a/src/hmc5883l/hmc5883l.h +++ b/src/hmc5883l/hmc5883l.h @@ -32,10 +32,14 @@ namespace upm { /** * @brief C++ API for HMC5883l (3-axis digital compass) * - * This file defines the HMC5883l C++ interface for libhmc5883l + * The Honeywell [HMC5883L] + * (http://www.adafruit.com/datasheets/HMC5883L_3-Axis_Digital_Compass_IC.pdf) + * is a 3-axis digital compass. Communication with the HMC5883L is simple and + * all done through an I2C interface. Different breakout boards are available, + * typically a 3V supply is all that is needed to power the sensor. * * @snippet hmc5883l.cxx Interesting - * + * @image html hmc5883l.jpeg */ class Hmc5883l {