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-10
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Magnetic
Downloaded: 4063 times
Not followed.
License: MIT license
3D Hall 2 click is a very accurate magnetic field sensing Click boardâ„¢, used to sense the magnetic field directions in all three axes. It relies on a TLV493D-A1B6, a low power 3D magnetic sensor, from Infineon.
Do you want to subscribe in order to receive notifications regarding "3D Hall 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "3D Hall 2 click" changes.
Do you want to report abuse regarding "3D Hall 2 click".
Library Description
The library initializes and defines the I2C bus driver and drivers that offer a choice for writing data in register and reads data from register. The library includes function for read hall X/Y/Z axis data, and temperature data.
Key functions:
void c3dhall2_getAxisTempData(float *axisData, float *tempData)
- Functions for gets Hall axis data and Temperature datavoid c3dhall2_configuration(uint8_t settings1, uint8_t settings2)
- Functions for settings chip for measurementExample description
The application is composed of three sections :
void applicationTask()
{
c3dhall2_getAxisTempData(&XYZ_Axis[0], &Temperature);
mikrobus_logWrite("Axis X: ", _LOG_TEXT);
FloatToStr(XYZ_Axis[0],demoText);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(" mT", _LOG_LINE);
mikrobus_logWrite("Axis Y: ", _LOG_TEXT);
FloatToStr(XYZ_Axis[1],demoText);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(" mT", _LOG_LINE);
mikrobus_logWrite("Axis Z: ", _LOG_TEXT);
FloatToStr(XYZ_Axis[2],demoText);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(" mT", _LOG_LINE);
mikrobus_logWrite("Temperature :", _LOG_TEXT);
FloatToStr(Temperature,demoText);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(" C", _LOG_LINE);
mikrobus_logWrite(" ", _LOG_LINE);
Delay_ms(3000);
}
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.