compass2 2.0.0.0
|
Compass 2 click carries the AK8963 3-axis electronic compass. The AK8963 sensor is based on the Hall effect.
We provide a library for the Compass2 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for Compass2 Click driver.
- Initialization function.void compass2_cfg_setup ( compass2_cfg_t *cfg );
COMPASS2_RETVAL compass2_init ( compass2_t *ctx, compass2_cfg_t *cfg );
void compass2_default_cfg ( compass2_t *ctx );
- This function prepares the device for a new measurement.int16_t compass2_get_axis_data ( compass2_t *ctx, uint8_t axis );
void compass2_new_measurement ( compass2_t *ctx );
void compass2_reset ( compass2_t *ctx );
The example prepares the device for a new measurement and reads and displays data from all three axes.
The demo application is composed of two sections :
Initializes and configures the click and logger modules.
Reads and displays data from all three axes every two seconds.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.