国产免费AV|泡泡玛特欧洲总部将设在伦敦|中文天堂网www新版资源在线|一本久道综合在线中文|国精产品一二三产区的使用方法|香蕉鱼在线观看|www.27eee
ELEOK
標(biāo)題:
基于51單片機(jī)的跑馬燈Proteus仿真和程序源碼
[打印本頁]
作者:
eng
時間:
2021-6-28 00:55
標(biāo)題:
基于51單片機(jī)的跑馬燈Proteus仿真和程序源碼
1.gif
(106.3 KB)
下載附件
2021-6-28 00:50 上傳
部分源碼如下:完整源碼見附件
程序.rar
(275.77 KB, 售價: 1 E幣)
2021-6-28 00:54 上傳
點擊文件名下載附件
售價: 1 E幣
[記錄]
[
購買
]
仿真.zip
(27.74 KB, 售價: 1 E幣)
2022-11-29 20:46 上傳
點擊文件名下載附件
售價: 1 E幣
[記錄]
[
購買
]
#include <REG52.H>
#include "SoundPlay.h"
unsigned char RunMode;
//**********************************System Fuction*************************************************
void Delay1ms(unsigned int count)
{
unsigned int i,j;
for(i=0;i<count;i++)
for(j=0;j<120;j++);
}
unsigned char code LEDDisplayCode[] = { 0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8, //0~7
0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x8E,0xFF};
void Display(unsigned char Value)
{
P3 = LEDDisplayCode[Value];
}
void LEDFlash(unsigned char Count)
{
unsigned char i;
bit Flag;
for(i = 0; i<Count;i++)
{
Flag = !Flag;
if(Flag)
Display(RunMode);
else
Display(0x10);
Delay1ms(100);
}
Display(RunMode);
}
unsigned char GetKey(void)
{
unsigned char KeyTemp,CheckValue,Key = 0x00;
CheckValue = P2&0x32;
if(CheckValue==0x32)
return 0x00;
Delay1ms(10);
KeyTemp = P2&0x32;
if(KeyTemp==CheckValue)
return 0x00;
if(!(CheckValue&0x02))
Key|=0x01;
if(!(CheckValue&0x10))
Key|=0x02;
if(!(CheckValue&0x20))
Key|=0x04;
return Key;
}
unsigned int Timer0Count,SystemSpeed,SystemSpeedIndex;
void InitialTimer2(void)
{
T2CON = 0x00; //16 Bit Auto-Reload Mode
TH2 = RCAP2H = 0xFC; //重裝值,初始值 TL2 = RCAP2L = 0x18;
ET2=1; //定時器 2 中斷允許
TR2 = 1; //定時器 2 啟動
EA=1;
}
unsigned int code SpeedCode[]={ 1, 2, 3, 5, 8, 10, 14, 17, 20, 30,
40, 50, 60, 70, 80, 90, 100, 120, 140, 160,
復(fù)制代碼
歡迎光臨 ELEOK (http://www.afoofa.cn/)
Powered by Discuz! X5.0