#include <reg52.h> #include<user_config.h> sbit Sevro_moto_pwm=P2^0; sbit key=P3^0; unsigned int pwm_val_left,push_val_left; /************************************************************************/ /* PWM 信号产生控制舵机 */ /************************************************************************/ /* */ /***************************************************/ ///*TIMER1中断服务子函数产生PWM信号*/ time0()interrupt 1 { pwm_val_left++; Sevro_moto_pwm = (pwm_val_left<=push_val_left) ? 1 : 0 ; if(pwm_val_left>=400) pwm_val_left=0; } void main() { unsigned char k