国产免费AV|泡泡玛特欧洲总部将设在伦敦|中文天堂网www新版资源在线|一本久道综合在线中文|国精产品一二三产区的使用方法|香蕉鱼在线观看|www.27eee
ELEOK
標題:
51單片機控制條形LED程序和Proteus仿真文件
[打印本頁]
作者:
coolfire
時間:
2021-5-6 01:00
標題:
51單片機控制條形LED程序和Proteus仿真文件
1.png
(35.95 KB)
下載附件
2021-5-6 00:59 上傳
部分代碼:
#include <reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar code DSY_CODE[]=
{
0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e,0x00
};
uchar code KeyCodeTable[]=
{
0x11,0x12,0x14,0x18,0x21,0x22,0x24,0x28,0x41,0x42,0x44,0x48,0x81,0x82,0x84,0x88
};
void Delay()
{
uchar i;
for(i=0;i<200;i++);
}
uchar Keys_Scan()
{
uchar sCode,kCode,i,k;
P1 = 0xf0;
if((P1&0xf0)!=0xf0)
{
Delay();
if((P1&0xf0)!=0xf0)
{
sCode = 0xfe;
for(k=0;k<4;k++)
{
P1 = sCode;
if((P1&0xf0)!=0xf0)
{
kCode = ~P1;
for(i=0;i<16;i++)
{
if(kCode == KeyCodeTable[i])
return i;
}
}
else
sCode = _crol_(sCode,1);
}
}
}
return -1;
}
復制代碼
完整單片機c代碼和仿真文件:
4×4鍵盤矩陣控制條形LED顯示.zip
(53.38 KB, 售價: 2 E幣)
2021-5-6 01:00 上傳
點擊文件名下載附件
售價: 2 E幣
[記錄]
[
購買
]
歡迎光臨 ELEOK (http://m.afoofa.cn/)
Powered by Discuz! X5.0