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,
-
復制代碼
【必讀】版權免責聲明
1、本主題所有言論和內容純屬會員個人意見,與本論壇立場無關。2、本站對所發內容真實性、客觀性、可用性不做任何保證也不負任何責任,網友之間僅出于學習目的進行交流。3、對提供的數字內容不擁有任何權利,其版權歸原著者擁有。請勿將該數字內容進行商業交易、轉載等行為,該內容只為學習所提供,使用后發生的一切問題與本站無關。 4、本網站不保證本站提供的下載資源的準確性、安全性和完整性;同時本網站也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的損失或傷害。 5、本網站所有軟件和資料均為網友推薦收集整理而來,僅供學習用途使用,請務必下載后兩小時內刪除,禁止商用。6、如有侵犯你版權的,請及時聯系我們(電子郵箱1370723259@qq.com)指出,本站將立即改正。
|