int n=0;
//定时器0的中断工作内容
void Timer0() interrupt 1 using 1
{
TR0=0;
TL0 = 0xf0;
TH0 = 0xff;
AD_calculate();
Kalman_Filter(acceler,gyro);
PWM_calculate();
PWM_motors(R_motor,L_motor);
n++;
TR0 = 1;
}
----------------------------------------------------
最后发现n一直是1啊 |