1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/drivers/hmc5883l
Hugues Larrive 3c465836f2 examples and tests: add atmega8 to relevent Makefile.ci
using dist/tools/insufficient_memory/add_insufficient_memory_board.sh
2023-07-11 21:22:02 +02:00
..
app.config.test tests/drivers: move all driver tests into own folder 2023-05-04 12:45:07 +02:00
main.c tests/drivers: move all driver tests into own folder 2023-05-04 12:45:07 +02:00
Makefile tests/drivers: move all driver tests into own folder 2023-05-04 12:45:07 +02:00
Makefile.ci examples and tests: add atmega8 to relevent Makefile.ci 2023-07-11 21:22:02 +02:00
README.md treewide: replace occurrences of tests/driver_ with new path 2023-05-06 15:38:21 +02:00

About

Test application for the HMC5883L 3-axis digital compass

Usage

The test application demonstrates the use of the HMC5883L. It uses the default configuration parameters.

  • Continuous measurement at a Data Output Rate (DOR) of 15 Hz
  • Normal mode, no biasing
  • Gain 1090 LSB/Gs
  • No averaging of data samples

The application can use different approaches to get new data:

  • using the #hmc5883l_read function at a lower rate than the the DOR
  • using the data-ready interrupt (DRDY), see #hmc5883l_init_int.

To use the data-ready interrupt (DRDY), the application has to enable module hmc5883l_int and has to configure the GPIO to which the interrupt signal is connected. This is done by overrding the default configuration parameter HMC5883L_PARAM_INT_PIN if necessary, for example:

USEMODULE=hmc5883l_int CFLAGS='-DHMC5883L_PARAM_INT_PIN=GPIO_PIN\(0,12\)' \
make flash -C tests/drivers/hmc5883l BOARD=...

The heading angle is calculated for a magnetic declination in radians defined by HMC5883L_MAG_DECL. This depends on the current location. The value for the current location can be determined at http://www.magnetic-declination.com/.