We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2018-11-30
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Magnetic
Downloaded: 3672 times
Not followed.
License: MIT license
Angle 2 click is a magnetic rotational sensor which relies on the ultra-fast MA700 angular sensor IC.
Do you want to subscribe in order to receive notifications regarding "Angle 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Angle 2 click" changes.
Do you want to report abuse regarding "Angle 2 click".
Library Description
The library can perform a control of the Angle 2 Click board. Also can measure the angle value in degrees with a range of 0 deg to 359.91 deg. Zero position setting also can be performed by using this library. The library offers a choice to save content of an entire selected register in OTP memory. For more details check documentation.
Key functions:
T_ANGLE2_DEG_VAL angle2_writeReg( uint8_t regAddr, uint8_t dataIn )
- Function writes one byte data to the register.T_ANGLE2_DEG_VAL angle2_getAngle( void )
- Function returns angle value in degrees with a range from 0 to 359.91.void angle2_setZeroScale( T_ANGLE2_DEG_VAL zeroDeg )
- Function sets a zero position value in degrees with 12-bit resolution.Examples description
The application is composed of the three sections :
void applicationTask()
{
angle = angle2_getAngle();
FloatToStr( angle, text );
floatCut();
mikrobus_logWrite( "Angle is: ", _LOG_TEXT );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( " deg", _LOG_LINE );
Delay_ms( 200 );
}
Additional Functions :
void floatCut()
- Makes float value to be rounded on two decimal places.Other mikroE Libraries used in the example:
Conversions
SPI
UART
Additional notes and information
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.