From fd2c710909a6bd2c9c8190c0f11178c5d834081b Mon Sep 17 00:00:00 2001 From: Fernando Herrero <fherrero@iri.upc.edu> Date: Wed, 30 Jan 2019 15:30:24 +0100 Subject: [PATCH] Update README.md --- README.md | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6c49e3d..955a90c 100644 --- a/README.md +++ b/README.md @@ -25,20 +25,20 @@ This package also requires of the following IRI libraries: Download this repository and create a build folder inside: -``` mkdir build ``` +> ``` mkdir build ``` Inside the build folder execute the following commands: -``` cmake .. ``` +> ``` cmake .. ``` The default build mode is DEBUG. That is, objects and executables include debug information. The RELEASE build mode optimizes for speed. To build in this mode execute instead -``` cmake .. -DCMAKE_BUILD_TYPE=RELEASE ``` +> ``` cmake .. -DCMAKE_BUILD_TYPE=RELEASE ``` The release mode will be kept until next time cmake is executed. -``` make ``` +> ``` make ``` In case no errors are reported, the generated libraries (if any) will be located at the _lib_ folder and the executables (if any) will be located at the _bin_ folder. @@ -46,7 +46,7 @@ _lib_ folder and the executables (if any) will be located at the _bin_ folder. In order to be able to use the library, it it necessary to copy it into the system. To do that, execute -``` make install ``` +> ``` make install ``` as root and the shared libraries will be copied to */usr/local/lib/iridrivers* directory and the header files will be copied to */usr/local/include/iridrivers* dierctory. At @@ -54,27 +54,46 @@ this point, the library may be used by any user. To remove the library from the system, exceute -``` make uninstall ``` +> ``` make uninstall ``` as root, and all the associated files will be removed from the system. To generate the documentation execute the following command: -``` make doc ``` +> ``` make doc ``` ## How to use it +### Test + +A test example is provided, which will output the battery information on the screen. + +First, you may need to: + + * unload the *ftdi_sio* module, so the device is detected as a serial-usb device: + +> ``` sudo rmmod ftdi_sio``` + + * load the *pcspkr* module, so the motherboard buzzers makes sound when alarms are enabled: +> ``` sudo modprobe pcspkr``` + +Then you can run the example and see the battery status information on the screen. + +> ``` ./bin/battery_monitor_test``` + +### Library + To use this library in an other library or application, in the CMakeLists.txt file, first it is necessary to locate if the library has been installed or not using the following command -``` FIND_PACKAGE(<library name>) ``` +> ``` FIND_PACKAGE(<library name>) ``` In the case that the package is present, it is necessary to add the header files directory to the include directory path by using -``` INCLUDE_DIRECTORIES(${<librray name>_INCLUDE_DIR}) ``` +> ``` INCLUDE_DIRECTORIES(${<librray name>_INCLUDE_DIR}) ``` and it is also necessary to link with the desired libraries by using the following command -``` TARGET_LINK_LIBRARIES(<executable name> ${<library name>_LIBRARY}) ``` +> ``` TARGET_LINK_LIBRARIES(<executable name> ${<library name>_LIBRARY}) ``` ## Disclaimer -- GitLab