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-10-24
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Magnetic
Downloaded: 3990 times
Not followed.
License: MIT license
3D HALL 5 click is a very accurate, magnetic field sensing Click board, used for sensing the magnetic field directions in all three axes. It relies on an IIS2MDCTR, a low power 3D magnetic sensor, from STMicroelectronics.
Do you want to subscribe in order to receive notifications regarding "3D HALL 5 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "3D HALL 5 click" changes.
Do you want to report abuse regarding "3D HALL 5 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 register. The library includes function for read magnetics X/Y/Z axis data, set offset, read interrupt state and read temperature. The user also has the function for initializes chip.
Key functions:
int16_t c3dhall5_getAxis(uint8_t axis)
- Functions for read axis datauint8_t c3dhall5_init()
- Functions for initialize the chipvoid c3dhall5_writeByte(uint8_t reg, uint8_t _data)
- Functions for write one byte in registerExample description
The application is composed of three sections :
void applicationTask()
{
axis_X = c3dhall5_getAxis(_C3DHALL5_AXIS_X);
mikrobus_logWrite(" X axis : ", _LOG_TEXT);
IntToStr(axis_X, demoText);
mikrobus_logWrite(demoText, _LOG_LINE);
axis_Y = c3dhall5_getAxis(_C3DHALL5_AXIS_Y);
mikrobus_logWrite(" Y axis : ", _LOG_TEXT);
IntToStr(axis_Y, demoText);
mikrobus_logWrite(demoText, _LOG_LINE);
axis_Z = c3dhall5_getAxis(_C3DHALL5_AXIS_Z);
mikrobus_logWrite(" Z axis : ", _LOG_TEXT);
IntToStr(axis_Z, demoText);
mikrobus_logWrite(demoText, _LOG_LINE);
mikrobus_logWrite(" ", _LOG_LINE);
Delay_ms( 1000 );
}
Other mikroE Libraries used in the example:
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.