capslider2 2.0.0.0
main.c File Reference

CapSlider2 Click example. More...

#include "board.h"
#include "log.h"
#include "capslider2.h"

Functions

void horizontal_check ()
 
void vertical_check ()
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

uint32_t wheel_avrg1
 
uint32_t wheel_avrg2
 
uint16_t out_val
 
uint8_t out_mode
 
uint8_t cnt
 

Detailed Description

CapSlider2 Click example.

Description

This application could be used for controlling various devices.

The demo application is composed of two sections :

Application Init

Initializes I2C interface, performs the device reset and configurations and sets the desired threshold value which determines sensor sensitivity.

Application Task

Checks for data ready and then read capacitance from all channels. There are two sliders on the clik board (X and Y). X slider selects which LEDs are being activated, while Y slider increases/decreases the LEDs intensity.

NOTE

In some cases, the user will need to wait several seconds after the click initialization for the sensor to be stabilized.

Author
MikroE Team

Function Documentation

◆ application_init()

void application_init ( void )

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 LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ horizontal_check()

void horizontal_check ( )

◆ main()

int main ( void )

◆ vertical_check()

void vertical_check ( )

Variable Documentation

◆ cnt

uint8_t cnt

◆ out_mode

uint8_t out_mode

◆ out_val

uint16_t out_val

◆ wheel_avrg1

uint32_t wheel_avrg1

◆ wheel_avrg2

uint32_t wheel_avrg2