SRA Board Components
ESP-IDF component for SRA Board
Macros | Functions
servo.c File Reference
#include "servo.h"
Include dependency graph for servo.c:

Macros

#define STR(A)   #A
 

Functions

esp_err_t enable_servo ()
 Enables Servo port on the sra board, sets up PWM for the three pins in servo port. More...
 
esp_err_t set_angle_servo (servo_config *config, unsigned int degree_of_rotation)
 Set the angle of the servos attached to the servo port of SRA Board. More...
 
int read_servo (servo_config *config)
 Get the angle of the servos. More...
 

Macro Definition Documentation

◆ STR

#define STR (   A)    #A

Function Documentation

◆ enable_servo()

esp_err_t enable_servo ( )

Enables Servo port on the sra board, sets up PWM for the three pins in servo port.

Returns
esp_err_t - returns ESP_OK if servo pins initialised, else it returns ESP_ERR_INVALID_ARG

◆ read_servo()

int read_servo ( servo_config config)

Get the angle of the servos.

Returns
esp_err_t

◆ set_angle_servo()

esp_err_t set_angle_servo ( servo_config config,
unsigned int  degree_of_rotation 
)

Set the angle of the servos attached to the servo port of SRA Board.

Parameters
configpointer to the servo_config struct
degree_of_rotationangle to which the servo must be set, depends on value of MAX_DEGREE macro
Returns
esp_err_t