This is an application illustrating a few basic examples on how to use the Common Sensor API and Font support facilities in the AVR Software Framework.
This example has been developed and tested on the XMEGA-A3BU Xplained evaluation kit with a Sensors Xplained Inertial 1 board (ATAVRSBIN1) fitted to the J1 and J2 expansion blocks.
Upon power up the example application will display brief text greeting on the LCD before guiding the user through a 3-step process that will calibrate the electronic compass on the ATAVRSBIN1 board to the local geomagnetic field.
The manual calibration process is simply a matter of orienting the sensor in a particular way and then calling the sensor_calibrate() routine. At each step a message on the monochrome will show directions on the required board orientation. The user moves to the next calibration stop by pressing the SW1
button on the evaluation board.
Once calibration is complete the calibration values are stored in non-volatile memory on the evaluation board and the application enters a loop that periodically updates a compass needle display along with data on the current magnetic direction, inclination and strength.
Relevant module dependencies for this application are:
This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.
For further information, visit Microchip.
Support and FAQ: https://www.microchip.com/support/