Boen_Shi 8be2866433 feat(base): 初始化 MSPM0 开发环境
- 添加头文件和配置文件支持
- 更新.gitignore忽略编译和IDE相关文件
- 添加基础的bsp代码
2026-07-16 14:45:26 +08:00

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);
}