Hardware Application Layer for Servo SG90 motor.
More...
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/mcpwm.h"
Go to the source code of this file.
Hardware Application Layer for Servo SG90 motor.
- Author
- Jesus Minjares (https://github.com/jminjares4)
- Version
- 0.1
- Date
- 2021-11-27
- Copyright
- Copyright (c) 2021
◆ SERVO_CLOSE
◆ SERVO_FREQ
◆ SERVO_GPIO
◆ SERVO_MAX_DEGREE
#define SERVO_MAX_DEGREE (90) |
◆ SERVO_MAX_PULSEWIDTH_US
#define SERVO_MAX_PULSEWIDTH_US (2000) |
◆ SERVO_MIN_PULSEWIDTH_US
#define SERVO_MIN_PULSEWIDTH_US (1000) |
◆ SERVO_OPEN
◆ SERVO_PWM_SIGNAL
#define SERVO_PWM_SIGNAL (mcpwm_io_signals_t)(MCPWM0A) |
◆ SERVO_PWM_UNIT
#define SERVO_PWM_UNIT (mcpwm_unit_t)MCPWM_UNIT_0 |
◆ SERVO_TIMER
#define SERVO_TIMER (mcpwm_timer_t)MCPWM_TIMER_0 |
◆ Servo
◆ haltServo()
void haltServo |
( |
Servo * |
servo | ) |
|
haltServo will stop the timer of the mcpwm
- Parameters
-
servo | pass a Servo motor by reference |
- Returns
- None
- Parameters
-
servo | pass a Servo motor by reference |
- Returns
- None
◆ moveServo()
void moveServo |
( |
Servo * |
servo, |
|
|
int |
angle |
|
) |
| |
moveServo will move the servo motor by angles
- Parameters
-
servo | pass a Servo by reference |
angle | int servo angle movment |
- Note
- Rangee for -90 to 90 degrees
- Parameters
-
servo | pass a Servo by reference |
angle | int servo angle movment |
- Note
- Rangee for -90 to 90 degrees
◆ servoInit()
void servoInit |
( |
Servo * |
servo | ) |
|
servoInit will initialize servo motor
- Parameters
-
servo | pass a Servo motor by reference |
- Parameters
-
servo | pass a Servo motor by reference |
◆ startServo()
void startServo |
( |
Servo * |
servo | ) |
|
startServo will start the time of the mcpwm
- Parameters
-
servo | pass a Servo motor by reference |
- Parameters
-
servo | pass a Servo motor by reference |