Cap Slider 3 Click
Cap Slider 3 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.
Click Library
- Author : Stefan Filipovic
- Date : Apr 2025.
- Type : I2C type
Software Support
Example Description
This example demonstrates the use of the Cap Slider 3 Click board by initializing the device and reading the current slider position. The application logs the detected slider position in real-time.
Example Libraries
- MikroSDK.Board
- MikroSDK.Log
- Click.CapSlider3
Example Key Functions
- capslider3_cfg_setup This function initializes Click configuration structure to initial values.
void capslider3_cfg_setup(capslider3_cfg_t *cfg)
Cap Slider 3 configuration object setup function.
Cap Slider 3 Click configuration object.
Definition capslider3.h:427
- capslider3_init This function initializes all necessary pins and peripherals used for this Click board.
err_t capslider3_init(capslider3_t *ctx, capslider3_cfg_t *cfg)
Cap Slider 3 initialization function.
Cap Slider 3 Click context object.
Definition capslider3.h:410
- capslider3_default_cfg This function executes a default configuration of Cap Slider 3 Click board.
err_t capslider3_default_cfg(capslider3_t *ctx)
Cap Slider 3 default configuration function.
- capslider3_read_data This function reads various system information and sensor data from the Click board.
err_t capslider3_read_data(capslider3_t *ctx, capslider3_data_t *data_out)
Cap Slider 3 read data function.
Cap Slider 3 Click data object object.
Definition capslider3.h:392
Application Init
Initializes the logger and the Cap Slider 3 Click driver.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
@ CAPSLIDER3_ERROR
Definition capslider3.h:445
#define CAPSLIDER3_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition capslider3.h:379
void application_init(void)
Definition main.c:49
Application Task
Continuously reads and logs the slider position detected by the Cap Slider 3 Click board.
{
{
{
log_printf ( &logger,
" Slider: - %u -\r\n\n", sys_info.
slider );
}
}
}
@ CAPSLIDER3_OK
Definition capslider3.h:444
#define CAPSLIDER3_SLIDER_IDLE
Definition capslider3.h:262
void application_task(void)
Definition main.c:85
uint16_t slider
Definition capslider3.h:395
Note
Functions for logging gestures and statuses are available but not used in this example.
Application Output
This Click board can be interfaced and monitored in two ways:
- Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
- UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Additional Notes and Information
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.