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: 2019-02-19
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Magnetic
Downloaded: 3765 times
Not followed.
License: MIT license
3D Hall 3 click is a very accurate, magnetic field sensing Click board, used to measure the intensity of the magnetic field across three perpendicular axes.
Do you want to subscribe in order to receive notifications regarding "3D Hall 3 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "3D Hall 3 click" changes.
Do you want to report abuse regarding "3D Hall 3 click".
Library Description
The library initializes and defines the I2C bus or SPI bus driver and drivers that offer a choice for writing data in registers and reading data from registers. The library includes function for read X/Y/Z axis data, set offset, read interrupt state. The user also has the function for configuration chip.
Key functions:
void c3dhall3_readXYZ( int16_t *OUT_XYZ )
- Reading X Y Z - axes valuesvoid c3dhall3_configuration( void )
- Click default configurationvoid c3dhall3_writeOffset(uint8_t axis, uint16_t offset )
- Writing X Y or Z-axis offsetExamples description
The application is composed of the three sections :
void applicationTask( )
{
c3dhall3_readXYZ( &axes_xyz[0] );
mikrobus_logWrite( " X:", _LOG_TEXT );
IntToStr( axes_xyz[0], text );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( " Y:", _LOG_TEXT );
IntToStr( axes_xyz[1], text );
mikrobus_logWrite( text, _LOG_TEXT );
mikrobus_logWrite( " Z:", _LOG_TEXT );
IntToStr( axes_xyz[2], text );
mikrobus_logWrite( text, _LOG_LINE );
Delay_ms(100);
}
Other mikroE Libraries used in the example:
I2C
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.