




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(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. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 眾籌購買合同范本
- 免招標(biāo)合同范本
- 買房贈(zèng)與車庫合同范本
- 冷凍物品購銷合同范本
- 2025屆中國電建集團(tuán)重慶工程有限公司秋季招聘筆試參考題庫附帶答案詳解
- 交流合同范本
- 義診合作合同范本
- 獸醫(yī)雇傭合同范本
- 創(chuàng)建服務(wù)合同范本
- 三方企業(yè)合資經(jīng)營合同范本
- 華師大版八年級(jí)數(shù)學(xué)下冊(cè)全冊(cè)教案
- 中國的能源安全 課件
- 期末總結(jié)600字四篇
- DCDC中恒定導(dǎo)通時(shí)間控制模式COT介紹
- 五險(xiǎn)一金繳費(fèi)明細(xì)表
- JJG 644-2003振動(dòng)位移傳感器
- GB/T 27648-2011重要濕地監(jiān)測(cè)指標(biāo)體系
- 全套教學(xué)課件《管理學(xué)基礎(chǔ)》
- (完整版)新標(biāo)準(zhǔn)大學(xué)英語視聽說教程3第二版整本書答案
- ISO13485-2016年《醫(yī)療器械質(zhì)量管理體系-用于法規(guī)要求》
- 【5A】雅思寫作課程課件
評(píng)論
0/150
提交評(píng)論