level 1
void mind()
{
Angle_get(); //获取陀螺仪,角度,角速度
pid_pwm = (int)angle(roll); //直立环换控制
// speed_get(); //获取速度
//velocity(); //速度换控制
PWM_TACCR0 =(-pid_pwm)+35000;
if(PWM_TACCR0>70000) PWM_TACCR0=69999; //===积分限幅
if(PWM_TACCR0<10000) PWM_TACCR0=9999; //===积分限幅
TIME_pwm_A1(); //pwm波输出 p7.7
TIME_pwm_A2(); //pwm波输出 p5.7
}
2021年10月30日 02点10分