freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

畢業(yè)論文-基于at89c51單片機(jī)的聲光控制開關(guān)的設(shè)計(jì)(編輯修改稿)

2024-11-28 12:14 本頁面
 

【文章內(nèi)容簡(jiǎn)介】 0=table[shi]。 西北民族大學(xué)學(xué)士學(xué)位論文 —————————————————————————————————————————————— 14 delay(1)。 P2=0xfd。 P0=table[ge]。 delay(1)。 P2=0xfc。 } AD 轉(zhuǎn)換程序 uchar adc0832(unsigned char ch) //AD 轉(zhuǎn)換,返回結(jié)果 。 { uchar i=0。 uchar j。 uint dat1=0。 uchar dat2=0。 if(ch==0)ch=2。 if(ch==1)ch=3。 adDI=1。 _nop_()。 _nop_()。 adCS=0。//拉低 CS 端 。 _nop_()。 _nop_()。 adCLK=1。//拉高 CLK 端 。 _nop_()。 _nop_()。 adCLK=0。//拉低 CLK 端 ,形成下降沿 1 。 _nop_()。 _nop_()。 adCLK=1。//拉高 CLK 端 。 adDI=champ。0x1。 _nop_()。 _nop_()。 adCLK=0。//拉低 CLK 端 ,形成下降沿 2 。 _nop_()。 _nop_()。 adCLK=1。//拉高 CLK 端 。 adDI=(ch1)amp。0x1。 _nop_()。 _nop_()。 adCLK=0。//拉低 CLK 端 ,形成下降沿 3 。 adDI=1。//控制命令結(jié)束 。 _nop_()。 西北民族大學(xué)學(xué)士學(xué)位論文 —————————————————————————————————————————————— 15 _nop_()。 dat1=0。 for(i=0。i8。i++) { dat1|=adDO。//收數(shù)據(jù) 。 adCLK=1。 _nop_()。 _nop_()。 adCLK=0。//形成一次時(shí)鐘脈沖 。 _nop_()。 _nop_()。 dat1=1。 if(i==7)dat1|=adDO。 } for(i=0。i8。i++) { j=0。 j=j|adDO。//收數(shù)據(jù) 。 adCLK=1。 _nop_()。 _nop_()。 adCLK=0。//形成一次時(shí)鐘脈沖 。 _nop_()。 _nop_()。 j=j7。 dat2=dat2|j。 if(i7)dat2=1。 } adCS=1。//拉低 CS 端 。 adCLK=0。//拉低 CLK 端 。 adDO=1。//拉 高數(shù)據(jù)端 ,回到初始狀態(tài) 。 dat1=8。 dat1|=dat2。 return(dat1)。 } 總程序 include include define uint unsigned int define uchar unsigned char uchar temp,aa,bai,shi,ge,tt。 西北民族大學(xué)學(xué)士學(xué)位論文 —————————————————————————————————————————————— 16 uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}。 // //數(shù)碼管段定義; uchar code table1[]={0xfb,0xfd,0xfe}。 //數(shù)碼管位定義; sbit open=P3^7。 sbit key1=P1^0。 sbit key2=P1^1。 sbit key3=P1^2。 sbit light=P3^2。 //ADC0832 的引腳 。 sbit adCS =P3^1。 //ADC0832 片選 。 sbit adDI =P3^3。 //ADC0832 通道選擇和初始化輸入 。 sbit adDO =P3^3。 //ADC0832 的數(shù)據(jù)輸出 。 sbit adCLK =P3^0。 //ADC0832 時(shí)鐘信號(hào) 。 uchar getdat。 //獲取 ADC 轉(zhuǎn)換回來的值 。 void display(uchar shi,uchar ge)。 void delay(uint z)。 void keyscan()。 void init()。 uchar adc0832(unsigned char channel)。 //主程序 ; void main() { init()。//初始化子程序 ; keyscan()。 while(1) { light=1。 //光線初始化為 0。 if(light==0) { getdat=adc0832(1)。 display(temp/10,temp%10)。 //顯示數(shù)字; if (getdat120) //聲音超過 后燈亮 。 { shi=temp/10。 //取出十位數(shù)字; ge=temp%10。 //取出個(gè)位數(shù)字; display(shi,ge)。 //顯示數(shù)字; TR0=1。 //啟動(dòng)定時(shí)器 0; if(aa==16) { open=0。 //開啟照明燈; aa=0。 temp。 //倒計(jì)時(shí); if(temp==1) { 西北民族大學(xué)學(xué)士學(xué)位論文 —————————————————————————————————————————————— 17 temp=0。 open=1。 //關(guān)閉照明燈; } } } } } } //延時(shí)函數(shù); void delay(uint z) { uint x,y。 for(x=z。x0。x) for(y=125。y0。y)。 } //顯示數(shù)碼管內(nèi)容; void display(uchar shi,uchar ge) { P2=0xfe。 P0=table[shi]。 delay(1)。 P2=0xfd。 P0=table[ge]。 delay(1)。 P2=0xfc。 } void init() { TMOD=0x01。 TH0=(6553650000)/256。 //給定時(shí)器 T0 的高 8 位賦初值; TL0=(6553650000)%256。 //給定時(shí)器 T0 的低 8 位賦初值; EA=1。 //開 cpu 總中斷; ET0=1。 //開 T0 中斷; TR0=0。 //關(guān)閉定時(shí)器 0; IE0=1。 //外中斷 0 初始化 。 IT0=1。 //下降沿觸發(fā) 。 EX0=1。 light=1。 //光線初始化為 0。 } //T0 中斷函數(shù) 。 void timer0() interrupt 1 { 西北民族大學(xué)學(xué)士學(xué)位論文 —————————————————————————————————————————————— 18 TH0=(6553650000)/256。 //賦初值; TL0=(6553650000)%256。 aa++。 } //外中斷 0 函數(shù) 。 void int0() interrupt 0 { light=0。 } //鍵盤掃描函數(shù) 。 void keyscan() { if(key1==0) { delay(5)。 //消抖; if(key1==0) //按下 key1 燈亮?xí)r間為 10s; { temp=10。 //10s 延時(shí); } } if(key2==0) { delay(5)。 //消抖; if(key2==0) //按下 key2 燈亮?xí)r間為 20s; { temp=20。 } } if(key3==0) { delay(5)。 //消抖; if(key3==0) //按下 key3 燈亮?xí)r間為 30s; { temp=30。 } } } uchar adc0832(unsigned char ch) //AD 轉(zhuǎn)換,返回結(jié)果 。 { uchar i=0。 uchar j。 uint dat1=0。 uchar dat2=0。 if(ch==0)ch=2。 西北民族大學(xué)學(xué)士學(xué)位論文 —————————————————————————————————————————————— 19 if(ch==1)ch=3。 adDI=1。 _nop_()。 _nop_()。 adCS=0。//拉低 CS 端 。 _nop_()。 _nop_()。 adCLK=1。//拉高 CLK 端 。 _nop_()。 _nop_()。 adCLK=0。//拉低 CLK 端 ,形成下降沿 1 。 _nop_()。 _nop_()。 adCLK=1。//拉高 CLK 端 。 adDI=champ。0x1。 _nop_()。 _nop_()。 adCLK=0。//拉低 CLK 端 ,形成下降沿 2 。 _nop_()。 _nop_()。 adCLK=1。//拉高 CLK 端 。 adDI=(ch1)amp。0x1。 _nop_()。 _nop_()。 adCLK=0。//拉低 CLK 端 ,形成下降沿 3 。 adDI=1。//控制命令結(jié)束 。 _nop_()。 _nop_()。 dat1=0。 for(i=0。i8。i++) { dat1|=adDO。//收數(shù)據(jù) 。 adCLK=1。 _nop_()。 _nop_()。 adCLK=0。//形成一次時(shí)鐘脈沖 。 _nop_()。 _nop_()。 dat1=1。 if(i==7)dat1|=adDO。 } for(i=0。i8。i++) { j=0。 西北民族大學(xué)學(xué)士學(xué)位論文 —————————————————————————————————————————————— 20 j=j|adDO。//收數(shù)據(jù) 。 adCLK=1。 _nop_()。 _nop_()。 adCLK=0。//形成一次時(shí)鐘脈沖 。 _nop_()。 _nop_()。 j=j7。 dat2=dat2|j。 if(i7)dat2=1。 } adCS=1。//拉低 CS 端 。 adCLK=0。//拉低 CLK 端 。 adDO=1。//拉高數(shù)據(jù)端 ,回到初始狀態(tài) 。 dat1=8。 dat1|=dat2。 return(dat1)。 } 本設(shè)計(jì)的程序是采用 C 語言來編寫,并且通過單片機(jī) Proteus 仿真軟件對(duì)程序進(jìn)行仿真。 Proteus 軟件中的 ISIS 模塊是電子系統(tǒng)仿真平臺(tái)軟件,主要完成電路原 理圖的繪制與仿真。硬件仿真圖如 41
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1