WALL-E servo motors class developed for hands and arm movements.
More...
#include <servos.h>
|
| | Servo (TIM_HandleTypeDef *htim, uint32_t channel) |
| | Constructor Function for Servo Motor Class.
|
| void | attach () |
| | Function starts the PWM Channel for the Servo Movement.
|
| void | detach () |
| | Function stops the PWM Signal received from the PWM.
|
| void | setPulseWidth (uint16_t pulse_us) |
| | Function sets the Servo's motor pulse width to determin the angle at which the servo moves to or holds.
|
| void | setAngle (uint8_t angleDeg) |
| | Function set's the Servo motor's pulse width based on the desired angle from the servo.
|
| void | startStopAngle (uint8_t angle1, uint8_t angle2) |
| | Function sets Servo to start to stop angle incrementing till requested angle.
|
|
| uint16_t | angleToPulse (uint8_t angleDeg) |
| | Function calculates the angle requested to the PWM pulse that is needed to create the angle.
|
WALL-E servo motors class developed for hands and arm movements.
◆ Servo()
| Servo::Servo |
( |
TIM_HandleTypeDef * | htim, |
|
|
uint32_t | channel ) |
Constructor Function for Servo Motor Class.
◆ angleToPulse()
| uint16_t Servo::angleToPulse |
( |
uint8_t | angleDeg | ) |
|
|
private |
Function calculates the angle requested to the PWM pulse that is needed to create the angle.
- Parameters
-
| angleDeg | Parameter that takes in the desired angle and translate to the pulse necessary to set the servo |
- Returns
- uint16_t
◆ attach()
Function starts the PWM Channel for the Servo Movement.
- Returns
- None
◆ detach()
Function stops the PWM Signal received from the PWM.
- Returns
- None
◆ setAngle()
| void Servo::setAngle |
( |
uint8_t | angleDeg | ) |
|
Function set's the Servo motor's pulse width based on the desired angle from the servo.
- Parameters
-
| angleDeg | Parameter that sets the servo to a position based on the actual angle rather than pulse |
- Returns
- None
◆ setPulseWidth()
| void Servo::setPulseWidth |
( |
uint16_t | pulse_us | ) |
|
Function sets the Servo's motor pulse width to determin the angle at which the servo moves to or holds.
- Parameters
-
| pulse_us | Parameter that determines what pulse to send to set the Servo to a specified angle |
- Returns
- None
◆ startStopAngle()
| void Servo::startStopAngle |
( |
uint8_t | angle1, |
|
|
uint8_t | angle2 ) |
Function sets Servo to start to stop angle incrementing till requested angle.
- Parameters
-
| angle1 | Parameter sets the starting angle to move the servo in a sequence |
| angle2 | Parameter sets the ending angle to move the servo in a sequence |
- Returns
- None
◆ channel
Private variable channel that takes in the specified Timer Channel definition from the STM32 Config for PWM
◆ htim
| TIM_HandleTypeDef* Servo::htim |
|
private |
Private variable htim that takes in the Timer definition from the STM32 Config
The documentation for this class was generated from the following files:
- C:/Users/arath/OneDrive/Documents/ME 507/Project-WALLE/Code/Inc/servos.h
- C:/Users/arath/OneDrive/Documents/ME 507/Project-WALLE/Code/src/servos.cpp