TOP Contributors

  1. MIKROE (2651 codes)
  2. Alcides Ramos (351 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 (136600 times)
  2. FAT32 Library (69803 times)
  3. Network Ethernet Library (55879 times)
  4. USB Device Library (46208 times)
  5. Network WiFi Library (41856 times)
  6. FT800 Library (41064 times)
  7. GSM click (28941 times)
  8. PID Library (26400 times)
  9. mikroSDK (26306 times)
  10. microSD click (25321 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: 5167 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

Gesture Board

1

The Gesture board, carrying Microchip’s MGSC3130 3D gesture recognition controller, brings a new approach to designing intuitive user interfaces. It’s like a touchpad whose input area extends 15cm upwards into space.

[Learn More]

Rec N Play click

0

Rec&Play Click is a digital voice recorder on a Click board™. It is based on the ISD3900, a multi-message record and playback device. It features the ChipCorder® technology, offering digital sound compression, smart message management, digitally configurable signal path, and more.

[Learn More]

LR 2 click

0

LR 2 Click is a compact add-on board that contains a low-power, long-range transceiver. This board features the RN2903, RF technology-based SRD transceiver, which operates at a frequency of 915MHz from Microchip Technology. This Click board™ features an embedded LoRaWAN Class A compliant stack, providing a long-range spread spectrum communication with high interference immunity. The RN2903 module is fully compliant with the United States (FCC) and Canada (IC) regulations combined with the advanced and straightforward command interface allowing easy integration into the final application.

[Learn More]