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

正文內(nèi)容

畢業(yè)設(shè)計(jì)-一種基于51單片機(jī)的粉塵監(jiān)測(cè)系統(tǒng)的設(shè)計(jì)—定稿-資料下載頁(yè)

2024-11-30 13:36本頁(yè)面

【導(dǎo)讀】但是,在生產(chǎn)過(guò)程產(chǎn)生很多對(duì)人體有害的因素工業(yè)生產(chǎn)過(guò)程中會(huì),例如煤炭?;议_(kāi)采、水泥生產(chǎn)等行業(yè)中的粉塵污染。單片機(jī)是通過(guò)ADC0832轉(zhuǎn)換芯片采集GP2Y1010AU粉塵傳感器的粉塵。二極管發(fā)出聲光報(bào)警。當(dāng)然,粉塵的濃度報(bào)警值我們可以通過(guò)按鍵來(lái)進(jìn)行設(shè)置。

  

【正文】 __LCD1602_H__ define __LCD1602_H__ include //添加延時(shí)函數(shù)頭文件 define LCD_PINDATA P0 //數(shù)據(jù)端口定義 P2 sbit RS = P1^4。 //RS P0^7 sbit RW = P1^5。 //RW P0^6 sbit E = P1^6。 //E P0^5 /************************************************ ** 函數(shù)名稱 : WriteCOMDATA(uchar LCD_DATA,uchar N) ** 函數(shù)功能 : LCD1602 寫(xiě)指令、數(shù)據(jù)函數(shù) ** 輸 入 : LCD_DATA:指令或者數(shù)據(jù) N:指令方式還是數(shù)據(jù)方式 N=0 時(shí), LCD_DATA 為指令, N=1 時(shí), LCD_DATA 為數(shù)據(jù) ** 輸 出 : 無(wú) ** 說(shuō) 明 : ************************************************/ void WriteCOMDATA(uchar LCD_DATA,uchar N) { Delay(1)。 E=1。 RW=0。 RS=N。 LCD_PINDATA=LCD_DATA。 E=0。 } /************************************************ ** 函數(shù)名稱 : void LCD_init(void) ** 函數(shù)功能 : LCD1602 初始化操作 ** 輸 入 : 無(wú) ** 輸 出 : 無(wú) ** 說(shuō) 明 : ************************************************/ void LCD_Init(void) { WriteCOMDATA(0x01,0)。 Delay(500)。 32 WriteCOMDATA(0x38,0)。 Delay(10)。 WriteCOMDATA(0x06,0)。 Delay(10)。 WriteCOMDATA(0x0c,0)。 Delay(10)。 } /************************************************ ** 函數(shù)名稱 : void WriteChar(uchar Row,uchar Col,uchar Num,uchar *pBuffer) ** 函數(shù)功能 :在任意位置寫(xiě)指定個(gè)字符 ** 輸 入 : Row : 要寫(xiě)的字符所在的行,只能為 1 或 2; Col : 要寫(xiě)的字符所在的列,只能為 015 Num : 要寫(xiě)字符的個(gè)數(shù) pbuffer : 要寫(xiě)字符的首地址 ** 輸 出 :無(wú) ** 說(shuō) 明 : ************************************************/ void WriteChar(uchar Row,uchar Col,uchar Num,uchar *pBuffer) { uchar i。 if(Row==1)Row=0x80+Col。 else Row=0xC0+Col。 WriteCOMDATA(Row,0)。 for(i=Num。i!=0。i) { WriteCOMDATA(*pBuffer,1)。 pBuffer++。 } } endifinclude //添加延時(shí)函數(shù)頭文件 include sbit CS = P1^2。 sbit Clk = P1^1。 sbit DATI = P1^0。 sbit DATO = P1^0。 /**************************************************************************** 函數(shù)功能 :AD 轉(zhuǎn)換子程序 入口參數(shù) :CH 出口參數(shù) :dat 33 ****************************************************************************/ unsigned char adc0832(unsigned char CH) { unsigned char dat = 0x00。 //AD 值 unsigned char i,test,adval。 adval = 0x00。 test = 0x00。 Clk = 0。 //初始化 DATI = 1。 _nop_()。 CS = 0。 _nop_()。 Clk = 1。 _nop_()。 if ( CH == 0x00 ) //通道選擇 { Clk = 0。 DATI = 1。 //通道 0 的第一位 _nop_()。 Clk = 1。 _nop_()。 Clk = 0。 DATI = 0。 //通道 0 的第二位 _nop_()。 Clk = 1。 _nop_()。 } else { Clk = 0。 DATI = 1。 //通道 1 的第一位 _nop_()。 Clk = 1。 _nop_()。 Clk = 0。 DATI = 1。 //通道 1 的第二位 _nop_()。 Clk = 1。 _nop_()。 34 } Clk = 0。 DATI = 1。 for( i = 0。i 8。i++ ) //讀取前 8 位的值 { _nop_()。 adval = 1。 Clk = 1。 _nop_()。 Clk = 0。 if (DATO) adval |= 0x01。 else adval |= 0x00。 } for (i = 0。 i 8。 i++) //讀取后 8 位的值 { test = 1。 if (DATO) test |= 0x80。 else test |= 0x00。 _nop_()。 Clk = 1。 _nop_()。 Clk = 0。 } if (adval == test) //比較前 8 位與后 8 位的值,如果不相同舍去。若一直出現(xiàn)顯示為零,請(qǐng)將該行去掉 dat = test。 _nop_()。 CS = 1。 //釋放 ADC0832 DATO = 1。 Clk = 1。 return dat。 } include sbit v_led = P3^2。 35 uint count_100us。 /************************************************ ** 函數(shù)名稱 : Init_Timer0(void) ** 函數(shù)功能 : 定時(shí)器 0 初 始化子程序 ** 輸 入 : 無(wú) ** 輸 出 : 無(wú) ** 說(shuō) 明 : 對(duì)定時(shí)器 0 進(jìn)行初始化 模式 1 16 位定時(shí)器 0~65536 ************************************************/ void Init_Timer0(void) //定時(shí)器初始化子程序 { TMOD |= 0x01。 //使用模式 1, 16 位定時(shí)器,使用 |符號(hào)可以在使用多個(gè)定時(shí)器時(shí)不受影響 TH0=0xFF。 //定時(shí)器賦初值 TL0=0xA4。 ET0=1。 //使能定時(shí)器中斷 TR0=1。 //打開(kāi)定時(shí)器 EA=1。 //打開(kāi)總中斷 } /************************************************ ** 函數(shù)名稱 : Timer0_isr(void) interrupt 1 using 1 ** 函數(shù)功能 : 定時(shí)器中斷程序 ** 輸 入 : 無(wú) ** 輸 出 : 無(wú) ** 說(shuō) 明 : 定時(shí)器計(jì)數(shù)到 65536 溢出執(zhí)行中斷函數(shù) 定時(shí)器重新賦值及狀態(tài)指示燈取反 ************************************************/ //void Timer0_isr(void) interrupt 1 using 1 //{ // TH0=0xFF。 //重新賦值 // TL0=0xA4。 // count_100us++。 // if(count_100us30)TEST=0。 // else if(count_100us90)TEST=1。 // else count_100us=0。 // //TEST=~TEST。 //狀態(tài)指示燈取反 //} /************************************************ * 文件功能: 延時(shí)函數(shù)頭文件 * 使用說(shuō)明: 在需要使用延時(shí)函數(shù)時(shí)添加此頭文件“ ” ************************************************/ 36 ifndef __DELAY_H__ define __DELAY_H__ include //include define uchar unsigned char define uint unsigned int /************************************************ ** 函數(shù)名稱 : Delay(uint T) ** 函數(shù)功能 : 延時(shí)函數(shù) ** 輸 入 : T延時(shí)倍數(shù) 大小 0~65535 ** 輸 出 : 無(wú) ** 說(shuō) 明 : ************************************************/ void Delay(uint T) { uchar i。 for(T。T0。T) for(i=200。i0。i)。 } endif
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1