c3dhall3  2.0.0.0
Main Page

3D Hall 3 click

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.

click Product page


Click library

Software Support

We provide a library for the 3DHall3 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for 3DHall3 Click driver.

Standard key functions :

Example key functions :

Examples Description

This example returns values of X,Y and Z axes.

The demo application is composed of two sections :

Application Init

Initializes driver and sets basic configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
// Logger initialization.
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
C3DHALL3_MAP_MIKROBUS( cfg, MIKROBUS_1 );
c3dhall3_init( &c3dhall3, &cfg );
c3dhall3_default_cfg ( &c3dhall3 );
log_info( &logger, "---- System Init ----" );
}

Application Task

Reads the values of the X,Y and Z axes.

void application_task ( void )
{
int16_t axes_xyz[3];
// Task implementation.
c3dhall3_read_xyz( &c3dhall3, axes_xyz );
log_printf( &logger, "X: %d \r\n", axes_xyz[ 0 ] );
log_printf( &logger, "Y: %d \r\n", axes_xyz[ 1 ] );
log_printf( &logger, "Z: %d \r\n", axes_xyz[ 2 ] );
Delay_ms( 100 );
}

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

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.