TOP Contributors

  1. MIKROE (2662 codes)
  2. Alcides Ramos (357 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137038 times)
  2. FAT32 Library (70167 times)
  3. Network Ethernet Library (56038 times)
  4. USB Device Library (46363 times)
  5. Network WiFi Library (41979 times)
  6. FT800 Library (41309 times)
  7. GSM click (29079 times)
  8. mikroSDK (26519 times)
  9. PID Library (26453 times)
  10. microSD click (25449 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

GeoMagnetic click

Rating:

5

Author: MIKROE

Last Updated: 2018-11-06

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Magnetic

Downloaded: 5225 times

Not followed.

License: MIT license  

GeoMagnetic click is a digital magnetometric click board which can measure the geomagnetic field in three perpendicular axes.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "GeoMagnetic click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "GeoMagnetic click" changes.

Do you want to report abuse regarding "GeoMagnetic click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

GeoMagnetic click

GeoMagnetic click

Native view of the GeoMagnetic click board.

View full image
GeoMagnetic click

GeoMagnetic click

Front and back view of the GeoMagnetic click board.

View full image

Library Description

Initializes and defines the SPI and I2C bus driver and driver functions, witch have ability to writting on registers and reading from registers. The functions also offer a choice to 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 ) - Function writes one byte data in register.

GEOMAG_RETVAL_T geomag_readReg( uint8_t *dataOut, const uint8_t registerAddress, const uint8_t nBytes ) - Function reads determined number of bytes from registers.

void geomag_readData( uint16_t *dataX, uint16_t *dataY, uint16_t *dataZ, uint16_t *resHall ) - Function reads 13-bit x and y axis data, 15-bit z axis data and 14-bit hall resistance data from data registers.

Examples 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 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 );
}

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 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.

ALSO FROM THIS AUTHOR

TempHum 19 click

0

Temp&Hum 19 Click is a compact add-on board that represents temperature and humidity sensing solution. This board features the BPS240, a highly accurate relative humidity and temperature sensor from Bourns. This sensor, characterized by its high accuracy (±2% from 20% to 80%RH (±4% over entire humidity range)) and high resolution, provides 10-bit data to the host controller with a configurable I2C interface.

[Learn More]

BroadR Reach click

5

BroadR-Reach click brings the industry grade communication standard to the mikroBUSâ„¢, which is built to be used in an Ethernet-based open network.

[Learn More]

LightRanger 2 click

0

LightRanger 2 click carries VL53L0X IC from STMicroelectronics, the word’s smallest Time-of-Flight ranging and gesture detector sensor. The click is designed to run on either 3.3V or 5V power supply. LightRanger 2 click communicates with the target microcontroller over I2C interface and the following pins on the mikroBUS line: RST, INT.

[Learn More]