TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 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 (137081 times)
  2. FAT32 Library (70222 times)
  3. Network Ethernet Library (56094 times)
  4. USB Device Library (46411 times)
  5. Network WiFi Library (42029 times)
  6. FT800 Library (41375 times)
  7. GSM click (29109 times)
  8. mikroSDK (26555 times)
  9. PID Library (26487 times)
  10. microSD click (25483 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: 5228 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

Click examples - Raspberry Pi 3

0

By adding two mikroBUS sockets to your Raspberry Pi 3, the Pi 3 click shield allows you to experiment with hundreds of click board from our ever expanding range. WiFi, Lora, Bluetooth, GSM, GPS, RFID, OLED, speech recognition, environmental sensors, movement sensors, biosensors, LEDs, relays, — you name it, we got it!

[Learn More]

Magnetic Rotary 2 click

0

Magnetic Rotary 2 Click is a compact add-on board used for accurate magnet-position sensing. This board features the AEAT-9922, an angular magnetic rotary sensor providing accurate angular measurement over a full 360 degrees of rotation from Broadcom Limited. The AEAT-9922 uses integrated Hall sensor elements with complex analog and digital signal processing within a single device. The absolute angle measurement provides an instant indication of the magnet's angular position with a selectable and one-time programmable resolution from 10 to 18 bits.

[Learn More]

Temp-Hum 5 click

5

Temp-Hum 5 click is a temperature and humidity sensing click board, packed with features that allow simple integration into any design. It can measure a wide range of temperature and relative humidity values with high accuracy.

[Learn More]