![基于51單片機(jī)心形流水燈C語言源程序_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-6/9/d42e9b0e-e919-4340-9e15-9888e9708d2d/d42e9b0e-e919-4340-9e15-9888e9708d2d1.gif)
![基于51單片機(jī)心形流水燈C語言源程序_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-6/9/d42e9b0e-e919-4340-9e15-9888e9708d2d/d42e9b0e-e919-4340-9e15-9888e9708d2d2.gif)
![基于51單片機(jī)心形流水燈C語言源程序_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-6/9/d42e9b0e-e919-4340-9e15-9888e9708d2d/d42e9b0e-e919-4340-9e15-9888e9708d2d3.gif)
![基于51單片機(jī)心形流水燈C語言源程序_第4頁](http://file3.renrendoc.com/fileroot_temp3/2022-6/9/d42e9b0e-e919-4340-9e15-9888e9708d2d/d42e9b0e-e919-4340-9e15-9888e9708d2d4.gif)
![基于51單片機(jī)心形流水燈C語言源程序_第5頁](http://file3.renrendoc.com/fileroot_temp3/2022-6/9/d42e9b0e-e919-4340-9e15-9888e9708d2d/d42e9b0e-e919-4340-9e15-9888e9708d2d5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、#include<reg51.h> unsigned int x,y; void delayms(unsigned int z) /延時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等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年聲學(xué)懸浮物監(jiān)測儀合作協(xié)議書
- 2025年基礎(chǔ)機(jī)械:液壓件合作協(xié)議書
- 2025年沼氣集中供氣系統(tǒng)合作協(xié)議書
- 2025年產(chǎn)品特許經(jīng)營合同常用版(4篇)
- 2025年二手房東房屋租賃合同標(biāo)準(zhǔn)版本(4篇)
- 2025年九年級音樂教師工作總結(jié)第二學(xué)期(二篇)
- 2025年買賣房產(chǎn)合同標(biāo)準(zhǔn)版本(2篇)
- 2025年個人房屋租賃合同協(xié)議參考樣本(三篇)
- 2025年臨時勞動協(xié)議標(biāo)準(zhǔn)范文(2篇)
- 2025年企業(yè)勞動員工勞動合同模板(2篇)
- 高中學(xué)生宿舍樓建設(shè)項目可行性研究報告
- 2024-2025學(xué)年物理人教版八年級上冊-6.4-密度的應(yīng)用-課件
- 礦山應(yīng)急管理培訓(xùn)
- 維吾爾醫(yī)優(yōu)勢病種
- DB41T 2486-2023 叉車維護(hù)保養(yǎng)與自行檢查規(guī)范
- 全國教學(xué)設(shè)計大賽一等獎英語七年級上冊(人教2024年新編)《Unit 2 Were Family!》單元教學(xué)設(shè)計
- 三相四線及三相三線錯誤接線向量圖分析及更正
- 白酒業(yè)務(wù)員考勤管理制度
- 【獨(dú)家揭秘】2024年企業(yè)微信年費(fèi)全解析:9大行業(yè)收費(fèi)標(biāo)準(zhǔn)一覽
- 家庭法律服務(wù)行業(yè)市場突圍建議書
- 高一數(shù)學(xué)同步優(yōu)品講練課件(人教A版2019必修第一冊)3.2 函數(shù)的基本性質(zhì)(課時3 函數(shù)的奇偶性)(課件)
評論
0/150
提交評論