| 欢迎光临MCUWAY! 本站网名:单片机之路 永久域名:www.mcuway.com |
|
|
单片机报警器制作 7. C语言源程序 #include unsigned int t02s; unsigned char t05ms; bit flag; void main(void) { TMOD=0x01; TH0=(65536-500)/256; TL0=(65536-500)%6; TR0=1; ET0=1; EA=1; while(1); } void t0(void) interrupt 1 using 0 { TH0=(65536-500)/256; TL0=(65536-500)%6; t02s++; if(t02s==400) { t02s=0; flag=~flag; } if(flag==0) { P1_0=~P1_0; } } |
|
|
|
|
|
|
|
学习单片机的必经之路——单片机之路,永久域名:www.mcuway.com |