servo2 2.1.0.0
Loading...
Searching...
No Matches
main.c File Reference

Servo 2 Click example. More...

#include "board.h"
#include "log.h"
#include "servo2.h"

Functions

void application_init (void)
void application_task (void)
int main (void)

Detailed Description

Servo 2 Click example.

Description

This example demonstrates the use of the Servo 2 Click board for controlling the angle of servo motors. The board is capable of driving multiple servos, and the example illustrates how to change the angle of all connected servos simultaneously within a defined range.

The demo application is composed of two sections:

Application Init

Initializes the logger module and configures the Servo 2 Click board. The PWM communication is established, and the device is prepared for controlling the servos.

Application Task

Gradually changes the angle of all connected servo motors from a minimum to a maximum value, and then back to the minimum, creating a sweeping motion. The current angle is logged during each update.

Note
Ensure that the servo motors are properly connected to the Servo 2 Click board and are compatible with the specified angle range such as the SG90 Micro Servo motors.
Author
Stefan Filipovic

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

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

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )