欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: 51單片機LED與數碼管的使用 [打印本頁]

作者: 7222    時間: 2020-4-20 07:03
標題: 51單片機LED與數碼管的使用
本帖最后由 7222 于 2020-4-20 07:05 編輯

代碼如下:
   #include<reg51.h>
sbit P0_4=P0^4;
int count=0;
char led_mod[]={0x3f,0x06,0x5b,0x4f,0x66,0x7d,0x07,0x6f,0x77,0x58,0x5e,0x79,0x71};
int0_key() interrupt 0
{
P0_4=!P0_4;
}
int1_key() interrupt 2
{
count++;
if(count>0x0f)
count=0;
P2=led_mod[count];
}
void main(){
IT0=1;
EX0=1;
EA=1;
IT1=1;
EX1=1;
P0_4=0;
P2=0x3f;
while(1);
}



仿真圖如下:








歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1