angle3
2.0.0.0
|
Angle 3 click carries the AK7451, a magnetic rotational angle sensor. The click is designed to run on a 5V power supply.
We provide a library for the Angle3 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 Angle3 Click driver.
void angle3_cfg_setup ( angle3_cfg_t *cfg );
ANGLE3_RETVAL angle3_init ( angle3_t *ctx, angle3_cfg_t *cfg );
void angle3_write_data ( angle3_t* ctx, uint8_t opcode, uint8_t reg, uint16_t write_data );
uint16_t angle3_read_data ( angle3_t* ctx, uint8_t opcode, uint8_t reg );
uint16_t angle3_read_angle_data( angle3_t* ctx );
This example reads data from the sensor, calculates and logs the result.
The demo application is composed of two sections :
Driver initialization, sets sensor to normal mode and starts writting to log.
Angle 3 Click communicates with registers via SPI, reads data from the angle sensor, calculates it to degrees and writes it to the terminal.
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.