高级会员
- 积分
- 598
- 威望
- 292
- 贡献
- 146
- 兑换币
- 174
- 注册时间
- 2017-4-4
- 在线时间
- 80 小时
- 毕业学校
- 北大
|
2#
楼主 |
发表于 2017-4-19 15:37:10
|
只看该作者
if(Left_PWM > 0)
{
Left_PWM_Out_A = Left_PWM+700 ;//700
Left_PWM_Out_B = 0;
}
else
{
Left_PWM_Out_A = 0;
Left_PWM_Out_B = -Left_PWM+500;//600
}
if(Right_PWM > 0)
{
Right_PWM_Out_A = Right_PWM+750 ;//460
Right_PWM_Out_B = 0;
}
else
{
Right_PWM_Out_A = 0;
Right_PWM_Out_B = -Right_PWM+850 ;//430
}
tpm_pwm_duty(TPM0,TPM_CH1,Right_PWM_Out_B); //后退
tpm_pwm_duty(TPM0,TPM_CH2,Right_PWM_Out_A);
tpm_pwm_duty(TPM0,TPM_CH3,Left_PWM_Out_B); //后退
tpm_pwm_duty(TPM0,TPM_CH4,Left_PWM_Out |
|