flag=0;
void
timer0() interrupt 1
{
if(t0_flag == 0)
{
t1_flag = 1;
PWM = 1;
TH0 = (65536 - tpwm )/256;
TL0 = (65536 - tpwm)%256;
}
else
{
t0_flag = 0;
PWM = 0;
TH1 = (65536- 10000 + tpwm )/256;
TL1 = (65536 - 10000 + tpwm )%256;
}
}
tpwm/10000 是否就是代表占空比?如果不行的话要如何实现?
没改清楚.. 我再改改
一周热门 更多>