magneto 2.0.0.0
|
MAGNETO Click carries contactless magnetic angle position sensor which delivers precise angle measurements down to 0.05º in 14-bit resolution.
We provide a library for the Magneto 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 Magneto Click driver.
- Initialization function.void magneto_cfg_setup ( magneto_cfg_t *cfg );
MAGNETO_RETVAL magneto_init ( magneto_t *ctx, magneto_cfg_t *cfg );
void magneto_default_cfg ( magneto_t *ctx );
- This function read the 16-bit data from register then calculate and convert to float angle value from 0deg to 360deg.uint16_t magneto_get_state ( magneto_t *ctx );
float magneto_calculate_angle ( magneto_t *ctx );
Example presents precise angle measurements down to 0.05º in 14-bit resolution.
The demo application is composed of two sections :
Application Init performs Logger and Click initialization.
Magneto Click communicates with register via SPI by write and read from register and calculate float angle value. Results are being sent to the UART Terminal where you can track their changes. All data logs on USB UART for aproximetly every 2 sec.
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.