TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 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 (136818 times)
  2. FAT32 Library (69983 times)
  3. Network Ethernet Library (55954 times)
  4. USB Device Library (46275 times)
  5. Network WiFi Library (41892 times)
  6. FT800 Library (41203 times)
  7. GSM click (28993 times)
  8. PID Library (26420 times)
  9. mikroSDK (26377 times)
  10. microSD click (25383 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

Magneto 7 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.16

mikroSDK Library: 2.0.0.0

Category: Magnetic

Downloaded: 122 times

Not followed.

License: MIT license  

Magneto 7 Click is a high-resolution magnetic sensor Click board™ which allows contactless orientation sensing.

No Abuse Reported

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

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

Do you want to report abuse regarding "Magneto 7 click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


Magneto 7 click

Magneto 7 Click is a high-resolution magnetic sensor Click board™ which allows contactless orientation sensing.

magneto7_click.png

click Product page


Click library

  • Author : MikroE Team
  • Date : Dec 2019.
  • Type : I2C type

Software Support

We provide a library for the Magneto7 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 Magneto7 Click driver.

Standard key functions :

  • Config Object Initialization function.

    void magneto7_cfg_setup ( magneto7_cfg_t *cfg );

  • Initialization function.

    MAGNETO7_RETVAL magneto7_init ( magneto7_t ctx, magneto7_cfg_t cfg );

  • Click Default Configuration function.

    void magneto7_default_cfg ( magneto7_t *ctx );

Example key functions :

  • This function returns INT pin state

    uint8_t magneto7_int_get ( magneto7_t *ctx );

  • This function gets register value(s).

    uint8_t magneto7_get_register ( magneto7_t ctx, uint8_t register_address, uint8_t data_buffer, uint8_t n_data );

  • This function gets raw device temperature value.

    void magneto7_get_temperature ( magneto7_t ctx, uint16_t device_temperature );

Examples Description

This demo application reads position of a magnet above the sensor.

The demo application is composed of two sections :

Application Init

Initializes device.

void application_init ( void )
{
    log_cfg_t log_cfg;
    magneto7_cfg_t cfg;
    uint8_t init_status;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----\r\n" );

    //  Click initialization.

    magneto7_cfg_setup( &cfg );
    MAGNETO7_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    magneto7_init( &magneto7, &cfg );
    Delay_ms ( 300 );

    init_status = magneto7_default_cfg( &magneto7 );
    if ( init_status == 0)
    {
        log_printf( &logger, "> app init done\r\n" );
    }
    else if ( init_status == 1 )
    {
        log_printf( &logger, "> app init fail\r\n" );
        for ( ; ; );
    }
}

Application Task

Waits for INT pin to go LOW, gets raw data, converts it to uT and logs results.

void application_task ( void )
{
    uint8_t int_status;
    float converted_data;

    int16_t data_x;
    int16_t data_y;
    int16_t data_z;

    int_status = magneto7_int_get( &magneto7 );

    if ( int_status == 0 )
    {
        magneto7_get_data( &magneto7, &data_x, &data_y, &data_z );

        converted_data = magneto7_convert_to_ut( &magneto7, data_x, MAGNETO7_SENSOR_RES_14_BIT );
        log_printf( &logger, "> X Axis : %f [uT]\r\n", converted_data );

        converted_data = magneto7_convert_to_ut( &magneto7, data_y, MAGNETO7_SENSOR_RES_14_BIT );
        log_printf( &logger, "> Y Axis : %f [uT]\r\n", converted_data );

        converted_data = magneto7_convert_to_ut( &magneto7, data_z, MAGNETO7_SENSOR_RES_14_BIT );
        log_printf( &logger, "> Z Axis : %f [uT]\r\n", converted_data );

        log_printf( &logger, "\r\n" );

        Delay_ms ( 300 );
    }
}

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:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Magneto7

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.


ALSO FROM THIS AUTHOR

RS485 7 click

0

RS485 7 Click is a compact add-on board that enables communication over an RS485 network. This board features the THVD1424, a full duplex RS485 transceiver with a selectable data rate from Texas Instruments. The THVD1424 offers several pin-controlled features, including an on-chip 120Ω termination resistor, slew rate control, and the ability to switch between half and full duplex mode. With its high immunity to IEC Contact Discharge ESD events, the bus pins require no additional system-level protection components. Additionally, the chip is known for its low power consumption and glitch-free power-up/power-down functionality, which enables hot plug-in capability.

[Learn More]

8 pin I2C click

5

8-pin I2C Click is a compact add-on board that represents a breakout board that simplifies the connection of add-on boards with 8 pin Female Connector to mikroBUSâ„¢ socket.

[Learn More]

LTE IoT 3 click

0

LTE IoT 3 Click is a compact add-on board that contains a Low Power Wide Area (LPWA) Wireless IoT module that allows connections to the LTE CAT-M1, CAT NB1/2, and 2G networks. This board features the EXS82-W, LTE-IoT Wireless Module from Thales that offers a rich set of Internet protocols and industry-standard interfaces such as UART, USB, etc. Global IoT connectivity, integrated GNSS support, SMS support, extended coverage range, and reduced power consumption makes this single IoT module an excellent choice for device makers while ensuring worldwide reliability.

[Learn More]