欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標(biāo)題:
51單片機中斷,含源程序,代碼
[打印本頁]
作者:
Mr-L
時間:
2018-11-18 18:01
標(biāo)題:
51單片機中斷,含源程序,代碼
中斷程序代碼
對初學(xué)者很有幫助
在學(xué)校實驗中得過驗證
運用proteus和keil軟件進行呈現(xiàn)
中斷.png
(24.91 KB, 下載次數(shù): 45)
下載附件
2018-11-18 17:58 上傳
#include<reg51.h>
#include<intrins.h>
sbit K2 = P3^2;
sbit K3 = P3^3;
void delayms(unsigned int m);
unsigned char aa = 0xfe;
void main()
{
EA = 1;
EX0 = 1;
EX1 = 1;
IT0 = 1; //跳變沿觸發(fā)方式
IT1 = 1; // 打開INT0的中斷允許
IP = 0xf1;
P1 = 0xff;
}
/*低級的外部中斷2,負(fù)責(zé)按鈕1 的操作,即實現(xiàn)流水燈*/
void button_1() interrupt 2
{
if(K3 == 0)
{
delayms(10);
if(K3 == 0)
{
while(1)
{
P1 = aa;
aa = _crol_(aa,1);
delayms(500);
}
}
}
}
/*外部中斷0(最高級),負(fù)責(zé)打斷外部中斷 2*/
void button_2() interrupt 0
{
if(K2 == 0)
{
delayms(10);
if(K2 == 0)
{
while(1)
;
}
}
}
void delayms(unsigned int m)
{
unsigned int i, j;
for(i = m; i > 0; i--)
{
for(j = 110; j > 0; j--)
;
}
}
復(fù)制代碼
中斷.docx
(108.77 KB, 下載次數(shù): 38)
2018-11-18 18:00 上傳
點擊文件名下載附件
具體內(nèi)容在文件中
下載積分: 黑幣 -5
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1