13 lines
437 B
C++
13 lines
437 B
C++
#include "../2025_include_user/Servo.h"
|
|
|
|
void Servo::SetUpAngle(const float angle) {
|
|
float pulse = ( (float)angle / 180.0f ) * 1000.0f + 250.0f;
|
|
DL_TimerG_setCaptureCompareValue(Servo_INST, (uint32_t)pulse, GPIO_Servo_C0_IDX);
|
|
}
|
|
|
|
|
|
void Servo::SetDownAngle(const float angle) {
|
|
float pulse = ( (float)angle / 270.0f ) * 1000.0f + 250.0f;
|
|
DL_TimerG_setCaptureCompareValue(Servo_INST, (uint32_t)pulse, GPIO_Servo_C1_IDX);
|
|
}
|