void T0_
time() interrupt 1 //¶¨Ê±Æ÷ÖжÏ
{
TH0=(65535-50000)/256; //ÖØ×°³õÖµ
TL0=(65535-50000)%256;
flag++;
if(flag == 20)
{
if(reduce_flag == FALSE)
{
num ++;
if(num == 9)
reduce_flag = TRUE;
}
else
{
num --;
if(num == 0)
reduce_flag = FALSE;
}
flag = 0;
}
}
void FM()
{
if(num==9)
{
spea=0;
delayms(1);
spea=1;
delayms(1);
}
}
受教了,我是刚开始学习单片机的菜鸟。以后希望多多帮助
一周热门 更多>