高级会员

- 积分
- 502
- 威望
- 280
- 贡献
- 136
- 兑换币
- 158
- 注册时间
- 2016-12-9
- 在线时间
- 43 小时
- 毕业学校
- 一中
|
各位大神看看是什么原因
void main()
{
FTM_PWM_Init(FTM2, FTM_CH1, 200, 50); //初始化FTM2_CH1输出频率为200HZ,占空比为50% 舵机处于0°位子
LPTMR_delay_ms(1000);
while(1)
{
FTM_PWM_Duty(FTM2, FTM_CH1, 40); //左摆45°
FTM_PWM_Duty(FTM2, FTM_CH1, 35); //左摆70°
LPTMR_delay_ms(1000);
FTM_PWM_Duty(FTM2, FTM_CH1, 65); //右摆80°
LPTMR_delay_ms(1000);
FTM_PWM_Duty(FTM2, FTM_CH1, 60); //右摆45°'[
LPTMR_delay_ms(1000);
FTM_PWM_Duty(FTM2,FTM_CH1, 50); //回中0°
LPTMR_delay_ms(1000);
}
}
|
|