Measure the tilt or orientation of an object relative to gravity
A
A
Hardware Overview
How does it work?
Inclinometer 4 Click is based on the FXLS8971CF, a compact 3-axis low-g MEMS accelerometer from NXP Semiconductor. The FXLS8971CF offers both high-performance and low-power operating modes, with user-selectable full-scale measurement ranges of ±2/4/8/16g, providing flexibility to match different applications' specific resolution and power needs. Key features include selectable output data rates with programmable resolution and idle-time settings, a flexible sensor data-change detection function for detecting motion or no motion, and the ability to detect high-g/low-g events, freefall, and other inertial activities. It also includes a 144-byte output data buffer (FIFO/LIFO), which helps minimize system power consumption and streamline data collection for the host system. This Click board™ measures angles of slope or elevation of an object with respect to gravity's direction, suitable for a wide array of industrial and medical IoT applications, including asset tracking, equipment monitoring, smart metering, tamper detection, orientation detection, and many more. Inclinometer 4 Click is designed in a unique format supporting the newly introduced MIKROE feature
called "Click Snap." Unlike the standardized version of Click boards, this feature allows the main sensor area to become movable by breaking the PCB, opening up many new possibilities for implementation. Thanks to the Snap feature, the FXLS8971CF can operate autonomously by accessing its signals directly on the pins marked 1-8. Additionally, the Snap part includes a specified and fixed screw hole position, enabling users to secure the Snap board in their desired location. This Click board™ allows for flexible communication options, supporting both I2C and SPI interfaces. These interfaces enable communication speeds up to 1MHz for I2C and 4MHz for SPI. Users can select their preferred communication protocol by adjusting the SMD jumpers in the COMM SEL section. These jumpers, as well as the COMM 1 jumper in the Snap section, must be aligned on the same side to avoid potential issues. Aside from additional interface signals configuration, an additional SMD jumper in the Snap section labeled COMM 2 also adjusts the I2C address. Besides the interface selection jumpers, this Click board™ features an additional jumper in
the Snap section of the Click board named BOOT. This jumper allows for device boot mode selection between the default operating mode (by placing the jumper in the GND position) and enabling motion detection mode (by placing it in the VCC position). Like standard Click board™, all signals from the main sensor, in this case, the FXLS8971CF, are available on the mikroBUS™ pins. In addition to standard communication pins, the FXLS8971CF utilizes two interrupt pins, IT1 and IT2, which are particularly useful when using the Motion Detection mode. When this mode is active, the IT1 pin sets the motion detection threshold, and the IT2 pin signals that the device boot process has been completed. If this mode is inactive, both pins function as standard programmable interrupt output pins. This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. Also, it comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Features overview
Development board
UNI Clicker is a compact development board designed as a complete solution that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It supports a wide range of microcontrollers, such as different ARM, PIC32, dsPIC, PIC, and AVR from various vendors like Microchip, ST, NXP, and TI (regardless of their number of pins), four mikroBUS™ sockets for Click board™ connectivity, a USB connector, LED indicators, buttons, a debugger/programmer connector, and two 26-pin headers for interfacing with external electronics. Thanks to innovative manufacturing technology, it allows you to build
gadgets with unique functionalities and features quickly. Each part of the UNI Clicker development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the UNI Clicker programming method, using a third-party programmer or CODEGRIP/mikroProg connected to onboard JTAG/SWD header, the UNI Clicker board also includes a clean and regulated power supply module for the development kit. It provides two ways of board-powering; through the USB Type-C (USB-C) connector, where onboard voltage regulators provide the appropriate voltage levels to each component on the board, or using a Li-Po/Li
Ion battery via an onboard battery connector. All communication methods that mikroBUS™ itself supports are on this board (plus USB HOST/DEVICE), including the well-established mikroBUS™ socket, a standardized socket for the MCU card (SiBRAIN standard), and several user-configurable buttons and LED indicators. UNI Clicker is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU

Type
8th Generation
Architecture
ARM Cortex-M7
MCU Memory (KB)
512
Silicon Vendor
STMicroelectronics
Pin count
100
RAM (Bytes)
262144
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Track your results in real time
Application Output
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support
Library Description
This library contains API for Inclinometer 4 Click driver.
Key functions:
inclinometer4_get_int2_pin
- This function returns the interrupt 2 (INT2) pin logic state.inclinometer4_get_data
- This function reads accel X, Y, and Z axis data in g and temperature in degrees Celsius.inclinometer4_set_mode
- This function sets the device operating mode to standby or active.
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* @file main.c
* @brief Inclinometer 4 Click example
*
* # Description
* This example demonstrates the use of Inclinometer 4 click board by reading and displaying
* accel data (X, Y, and Z axis) as well as temperature measurements on the USB UART.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver and performs the click default configuration which enables data ready
* interrupt on INT2 pin and sets full scale range to +/-2G and output data rate to 160ms.
*
* ## Application Task
* Waits for a data ready interrupt, then reads and displays the accel data (X, Y, and Z axis)
* as well as temperature measurements on the USB UART.
*
* @author Stefan Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "inclinometer4.h"
static inclinometer4_t inclinometer4;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
inclinometer4_cfg_t inclinometer4_cfg; /**< Click config object. */
/**
* 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 " );
// Click initialization.
inclinometer4_cfg_setup( &inclinometer4_cfg );
INCLINOMETER4_MAP_MIKROBUS( inclinometer4_cfg, MIKROBUS_1 );
err_t init_flag = inclinometer4_init( &inclinometer4, &inclinometer4_cfg );
if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( INCLINOMETER4_ERROR == inclinometer4_default_cfg ( &inclinometer4 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
inclinometer4_data_t accel_data;
// Wait for a data ready interrupt
while ( inclinometer4_get_int2_pin ( &inclinometer4 ) );
if ( INCLINOMETER4_OK == inclinometer4_get_data ( &inclinometer4, &accel_data ) )
{
log_printf( &logger, " X: %.3f g\r\n", accel_data.x );
log_printf( &logger, " Y: %.3f g\r\n", accel_data.y );
log_printf( &logger, " Z: %.3f g\r\n", accel_data.z );
log_printf( &logger, " Temperature: %d degC\r\n\n", ( int16_t ) accel_data.temperature );
}
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
// ------------------------------------------------------------------------ END