版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、#include<reg51.h> unsigned int x,y; void delayms(unsigned int z) /延時(shí)unsigned int i,j; for(i=z;i>0;i-) for(j=150;j>0;j-); void On_all() /開啟所有燈 P0=0x00; P1=0x00; P2=0x00; P3=0x00; void Off_all()/關(guān)閉所有燈 P0=0xff; P1=0xff; P2=0xff; P3=0xff; void ls()/正向流水燈 P0=0x00; delayms(400);P2=0x00; delaym
2、s(400);P3=0x00; delayms(400);P1=0x00; delayms(400); P0=0x01; delayms(50); P0=0x02; delayms(50); P0=0x04; delayms(50); P0=0x08; delayms(50); P0=0x10; delayms(50); P0=0x20; delayms(50); P0=0x40; delayms(50); P0=0x80; delayms(50); P0=0x00; P2=0x01; delayms(50); P2=0x02; delayms(50); P2=0x04; delayms(50
3、); P2=0x08; delayms(50); P2=0x10; delayms(50); P2=0x20; delayms(50); P2=0x40; delayms(50); P2=0x80; delayms(50); P2=0x00; P3=0x80; delayms(50); P3=0x40; delayms(50); P3=0x20; delayms(50); P3=0x10; delayms(50); P3=0x08; delayms(50); P3=0x04; delayms(50); P3=0x02; delayms(50); P3=0x01; delayms(50); P3
4、=0x00; P1=0x80; delayms(50); P1=0x40; delayms(50); P1=0x20; delayms(50); P1=0x10; delayms(50); P1=0x08; delayms(50); P1=0x04; delayms(50); P1=0x02; delayms(50); P1=0x01; delayms(50); P1=0x00;Off_all();P0=0xfe; delayms(50);P0=0xfd; delayms(50);P0=0xfb; delayms(50); P0=0xf7; delayms(50); P0=0xef; dela
5、yms(50); P0=0xdf; delayms(50); P0=0xbf; delayms(50); P0=0x7f; delayms(50); P0=0xff;P2=0xfe; delayms(50);P2=0xfd; delayms(50);P2=0xfb; delayms(50); P2=0xf7; delayms(50); P2=0xef; delayms(50); P2=0xdf; delayms(50); P2=0xbf; delayms(50); P2=0x7f; delayms(50); P2=0xff;P3=0x7f; delayms(50);P3=0xbf; delay
6、ms(50);P3=0xdf; delayms(50); P3=0xef; delayms(50); P3=0xf7; delayms(50); P3=0xfb; delayms(50); P3=0xfd; delayms(50);P3=0xfe; delayms(50); P3=0xff; P1=0x7f; delayms(50);P1=0xbf; delayms(50);P1=0xdf; delayms(50); P1=0xef; delayms(50); P1=0xf7; delayms(50); P1=0xfb; delayms(50); P1=0xfd; delayms(50);P1
7、=0xfe; delayms(50);P1=0xff;P0=0xfe; delayms(50);P0=0xfc; delayms(50);P0=0xf8; delayms(50);P0=0xf0; delayms(50);P0=0xe0; delayms(50);P0=0xc0; delayms(50);P0=0x80; delayms(50);P0=0x00; delayms(50);P2=0xfe; delayms(50);P2=0xfc; delayms(50);P2=0xf8; delayms(50);P2=0xf0; delayms(50);P2=0xe0; delayms(50);
8、P2=0xc0; delayms(50);P2=0x80; delayms(50);P2=0x00; delayms(50); P3=0x7f; delayms(50);P3=0x3f; delayms(50);P3=0x1f; delayms(50);P3=0x0f; delayms(50);P3=0x07; delayms(50);P3=0x03; delayms(50);P3=0x01; delayms(50);P3=0x00; delayms(50);P1=0x7f; delayms(50);P1=0x3f; delayms(50);P1=0x1f; delayms(50);P1=0x
9、0f; delayms(50);P1=0x07; delayms(50);P1=0x03; delayms(50);P1=0x01; delayms(50);P1=0x00; delayms(50); void fan_ls()/反向流水燈 Off_all(); delayms(300);On_all(); delayms(300);Off_all(); delayms(300);P1=0x00;delayms(400); P3=0x00;delayms(400); P2=0x00;delayms(400); P0=0x00;delayms(400); P1=0x01;delayms(50);
10、 P1=0x02;delayms(50); P1=0x04;delayms(50); P1=0x08;delayms(50); P1=0x10;delayms(50); P1=0x20;delayms(50); P1=0x40;delayms(50); P1=0x80;delayms(50); P1=0x00; P3=0x01;delayms(50); P3=0x02;delayms(50); P3=0x04;delayms(50); P3=0x08;delayms(50); P3=0x10;delayms(50); P3=0x20;delayms(50); P3=0x40;delayms(5
11、0); P3=0x80;delayms(50);P3=0x00; P2=0x80;delayms(50);P2=0x40;delayms(50); P2=0x20;delayms(50); P2=0x10;delayms(50);P2=0x08;delayms(50); P2=0x04;delayms(50); P2=0x02;delayms(50); P2=0x01;delayms(50);P2=0x00; P0=0x80;delayms(50); P0=0x40;delayms(50); P0=0x20;delayms(50); P0=0x10;delayms(50); P0=0x08;d
12、elayms(50); P0=0x04;delayms(50); P0=0x02;delayms(50); P0=0x01;delayms(50);P0=0x00;Off_all();P1=0xfe; delayms(50);P1=0xfd; delayms(50);P1=0xfb; delayms(50); P1=0xf7; delayms(50); P1=0xef; delayms(50); P1=0xdf; delayms(50); P1=0xbf; delayms(50); P1=0x7f; delayms(50);P1=0xff;P3=0xfe; delayms(50);P3=0xf
13、d; delayms(50);P3=0xfb; delayms(50); P3=0xf7; delayms(50); P3=0xef; delayms(50); P3=0xdf; delayms(50); P3=0xbf; delayms(50); P3=0x7f; delayms(50);P3=0xff;P2=0x7f; delayms(50);P2=0xbf; delayms(50); P2=0xdf; delayms(50);P2=0xef; delayms(50); P2=0xf7; delayms(50);P2=0xfb; delayms(50); P2=0xfd; delayms(
14、50); P2=0xfe; delayms(50);P2=0xff;P0=0x7f; delayms(50);P0=0xbf; delayms(50); P0=0xdf; delayms(50);P0=0xef; delayms(50); P0=0xf7; delayms(50);P0=0xfb; delayms(50); P0=0xfd; delayms(50); P0=0xfe; delayms(50);P0=0xff; P1=0xfe; delayms(50);P1=0xfc; delayms(50); P1=0xf8; delayms(50);P1=0xf0; delayms(50);
15、 P1=0xe0; delayms(50);P1=0xc0; delayms(50); P1=0x80; delayms(50); P1=0x00; delayms(50);P3=0xfe; delayms(50);P3=0xfc; delayms(50); P3=0xf8; delayms(50);P3=0xf0; delayms(50); P3=0xe0; delayms(50);P3=0xc0; delayms(50); P3=0x80; delayms(50); P3=0x00; delayms(50);P2=0x7f; delayms(50);P2=0x3f; delayms(50)
16、; P2=0x1f; delayms(50);P2=0x0f; delayms(50); P2=0x07; delayms(50);P2=0x03; delayms(50); P2=0x01; delayms(50); P2=0x00; delayms(50);P0=0x7f; delayms(50);P0=0x3f; delayms(50); P0=0x1f; delayms(50);P0=0x0f; delayms(50); P0=0x07; delayms(50);P0=0x03; delayms(50); P0=0x01; delayms(50); P0=0x00; delayms(5
17、0);Off_all();On_all();Off_all();On_all();Off_all();void ban_shan()/半邊交替閃Off_all();P1=0x00;P3=0x00;delayms(50);P0=0xff;P2=0xff;delayms(50);P1=0xff;P3=0xff;delayms(50);P0=0x00;P2=0x00;delayms(50);P1=0x00;P3=0x00;delayms(50);P0=0xff;P2=0xff;delayms(50);P1=0xff;P3=0xff;delayms(50);P0=0x00;P2=0x00;delaym
18、s(50);P1=0x00;P3=0x00;delayms(50);P0=0xff;P2=0xff;delayms(50);P1=0xff;P3=0xff;delayms(50);P0=0x00;P2=0x00;delayms(50);P1=0x00;P3=0x00;delayms(50);P0=0xff;P2=0xff;delayms(50);P1=0xff;P3=0xff;delayms(50);P0=0x00;P2=0x00;delayms(50);P1=0x00;P3=0x00;delayms(50);P0=0xff;P2=0xff;delayms(50);P1=0xff;P3=0xf
19、f;delayms(50);P0=0x00;P2=0x00;delayms(50); void shangxia_shan()/上下交替閃 On_all();Off_all();P0=0x00;P1=0x00;delayms(50);P2=0xff;P3=0xff;delayms(50);P0=0xff;P1=0xff;delayms(50);P2=0x00;P3=0x00;delayms(50);P0=0x00;P1=0x00;delayms(50);P2=0xff;P3=0xff;delayms(50);P0=0xff;P1=0xff;delayms(50);P2=0x00;P3=0x00
20、;delayms(50);P0=0x00;P1=0x00;delayms(50);P2=0xff;P3=0xff;delayms(50);P0=0xff;P1=0xff;delayms(50);P2=0x00;P3=0x00;delayms(50);P0=0x00;P1=0x00;delayms(50);P2=0xff;P3=0xff;delayms(50);P0=0xff;P1=0xff;delayms(50);P2=0x00;P3=0x00;delayms(50);P0=0x00;P1=0x00;delayms(50);P2=0xff;P3=0xff;delayms(50);P0=0xff
21、;P1=0xff;delayms(50);P2=0x00;P3=0x00;delayms(50); void huayang_shan()/花樣閃爍On_all();delayms(400);P0=0xff;P2=0x00;P3=0x00;P1=0x00;delayms(200);P0=0x00;P2=0xff;P3=0x00;P1=0x00;delayms(200);P0=0x00;P2=0x00;P3=0xff;P1=0x00;delayms(200);P0=0x00;P2=0x00;P3=0x00;P1=0xff;delayms(200);P0=0x00;P2=0x00;P3=0xff;
22、P1=0x00;delayms(200);P0=0x00;P2=0xff;P3=0x00;P1=0x00;delayms(200);P0=0xff;P2=0x00;P3=0x00;P1=0x00;delayms(200);On_all();delayms(400);P0=0x00;P2=0x00;P3=0x00;P1=0xff;delayms(200);P0=0x00;P2=0x00;P3=0xff;P1=0x00;delayms(200);P0=0x00;P2=0xff;P3=0x00;P1=0x00;delayms(200);P0=0xff;P2=0x00;P3=0x00;P1=0x00;delayms(200);P0=0x00;P2=0xff;P3=0x00;P1=0x
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025合法的多人承包合同模板
- 2025租賃合同普通我方為承租人
- 2025切邊模具合同書
- 老屋修復(fù)技術(shù)在國(guó)內(nèi)外的發(fā)展現(xiàn)狀對(duì)比分析
- 2024年肛腸科醫(yī)院項(xiàng)目資金申請(qǐng)報(bào)告代可行性研究報(bào)告
- 探究學(xué)生自我監(jiān)控學(xué)習(xí)過(guò)程的有效策略
- 老年人用藥注意事項(xiàng)
- 二零二五年度電梯安裝工程安全防護(hù)設(shè)施采購(gòu)合同2篇
- 2025年牛津譯林版必修3歷史上冊(cè)月考試卷
- 2025年魯科五四新版九年級(jí)地理上冊(cè)月考試卷含答案
- GB/T 45107-2024表土剝離及其再利用技術(shù)要求
- 2024-2025學(xué)年八年級(jí)上學(xué)期1月期末物理試題(含答案)
- 商場(chǎng)電氣設(shè)備維護(hù)勞務(wù)合同
- 《妊娠期惡心嘔吐及妊娠劇吐管理指南(2024年)》解讀
- 2023年國(guó)家公務(wù)員錄用考試《行測(cè)》真題(行政執(zhí)法)及答案解析
- 全國(guó)教學(xué)設(shè)計(jì)大賽一等獎(jiǎng)英語(yǔ)七年級(jí)上冊(cè)(人教2024年新編)《Unit 2 Were Family!》單元教學(xué)設(shè)計(jì)
- 2024智慧醫(yī)療數(shù)據(jù)字典標(biāo)準(zhǔn)值域代碼
- 年產(chǎn)12萬(wàn)噸裝配式智能鋼結(jié)構(gòu)項(xiàng)目可行性研究報(bào)告模板-立項(xiàng)備案
- 【獨(dú)家揭秘】2024年企業(yè)微信年費(fèi)全解析:9大行業(yè)收費(fèi)標(biāo)準(zhǔn)一覽
- 醫(yī)療器械經(jīng)銷商會(huì)議
- 《±1100kV特高壓直流換流變壓器使用技術(shù)條件》
評(píng)論
0/150
提交評(píng)論