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-06-27
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Magnetic
Downloaded: 3084 times
Not followed.
License: MIT license
3D HALL 7 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 7 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "3D Hall 7 click" changes.
Do you want to report abuse regarding "3D Hall 7 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 and reads data from register. The library includes function for read magnetics X/Y/Z axis data, configuration device, reads interrupt states and device info(company ID and device ID).
Key functions:
void c3dhall7_getAxisData( T_C3DHALL7_AXIS *axis)
- Get Axis data.void c3dhall7_configuration(uint8_t reg, uint16_t dataIn)
- Configuration function.Examples description
The application is composed of the three sections :
void applicationTask()
{
char demoText[ 50 ];
c3dhall7_getAxisData(&axis);
mikrobus_logWrite("---- Measurement data of magnetic sensor ----", _LOG_LINE);
IntToStr(axis.x, demoText);
mikrobus_logWrite("** X axis: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_LINE);
IntToStr(axis.y, demoText);
mikrobus_logWrite("** Y axis: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_LINE);
IntToStr(axis.z, demoText);
mikrobus_logWrite("** Z axis: ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_LINE);
mikrobus_logWrite("---------------------------------------------", _LOG_LINE);
Delay_ms( 500 );
}
Other mikroE Libraries used in the example:
SPI Library
I2C Library
UART Library
Conversions Library
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.