GeoMagnetic Click Board
GeoMagnetic Click Board
The GeoMagnetic Click Board™ is a digital magnetometric Click Board™ that can measure the geomagnetic field in three perpendicular axes. The onboard sensor uses FlipCore - a proprietary technology from Bosch, which results in a carefully tuned performance, tailored for demanding 3-axis mobile applications, such as a tilt-compensated electronic compass, gaming controllers, augmented reality applications and similar applications which require reliable and precise 3-axis magnetometric measurement.
Software Support
We provide a library for the GeoMagnetic Click Board™ on our Libstock page, as well as a demo application (example), developed using MikroElektronika compilers and mikroSDK. The provided click library is mikroSDK standard compliant. The demo application can run on all the main MikroElektronika development boards.
Library Description
Initializes and defines the SPI and I2C bus driver and driver functions, which has the ability to write on registers and reading from registers. The functions also offer a choice of reading x, y, and z-axis data and hall resistance data when data is ready for reading. For more details check the documentation.
Key Functions
GEOMAG_RETVAL_T geomag_writeReg( uint8_t dataIn, const uint8_t registerAddress )
- The function writes one byte of data in the register.
GEOMAG_RETVAL_T geomag_readReg( uint8_t *dataOut, const uint8_t registerAddress, const uint8_t nBytes )
- The function reads the determined number of bytes from registers.
void geomag_readData( uint16_t *dataX, uint16_t *dataY, uint16_t *dataZ, uint16_t *resHall )
- The function reads 13-bit x and y-axis data, 15-bit z-axis data, and 14-bit hall resistance data from data registers.
Example Description
- The application is composed of three sections:
- System Initialization - Initializes peripherals and pins.
- Application Initialization - Initializes SPI driver, performs power-on reset and configures the device so that all channels (x, y, and z) is enabled and Data Ready bit is active on high (Data Ready bit must be configured that is active on high).
Application Task - (code snippet) - Reads axis data after each 500ms and logs results on USB UART.
void applicationTask() { geomag_readData( &axisX, &axisY, &axisZ, &RHall ); WordToStr( axisX, text ); mikrobus_logWrite( "X axis: ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_LINE ); WordToStr( axisY, text ); mikrobus_logWrite( "Y axis: ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_LINE ); WordToStr( axisZ, text ); mikrobus_logWrite( "Z axis: ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_LINE ); mikrobus_logWrite( "", _LOG_LINE ); Delay_ms( 500 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- Conversions
- SPI
- UART
Additional Notes and Information
Depending on the development board you are using, you may need a 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.
MIKROSDK
The GeoMagnetic Click Board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
GeoMagnetic Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.