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

正文內容

智能家居警報系統(tǒng)設計物聯(lián)網(wǎng)實訓設計報告(參考版)

2025-07-23 01:44本頁面
  

【正文】 } }42。 lcd_wdat(*q)。\039。}函數(shù)名稱:display()功能 :在LCD上顯示數(shù)組的數(shù)據(jù) ,打印模式說明 :先寫顯示地址,后寫顯示數(shù)據(jù)調用 :lcd_wcmd(), lcd_pos()入口參數(shù):pos 寫入的位置,q指向要寫入的數(shù)據(jù)所在的數(shù)組返回值 :無void display(uchar pos, uchar *q){ lcd_pos(pos)。 lcd_wcmd(0x0c)。 lcd_wcmd(0x06)。 lcd_wcmd(0x01)。 lcd_wcmd(0x08)。 lcd_wcmd(0x38)。 }void lcd_init(){ //LCD初始化設定 lcd_wcmd(0x38)。 ep = 1。 ep = 0。 rs = 1。 }void lcd_pos(uchar pos){ //設定顯示位置 lcd_wcmd(pos | 0x80)。 ep = 1。 ep = 0。 rs = 0。 return result。 0x80)。 ep = 1。 rs = 0。 }}void longdelay(uchar s) //長延時{ while(s) { delay(80)。 i void delay(uchar ms){ // 延時子程序 uchar i。void display(uchar,uchar *)。void lcd_pos(uchar)。void lcd_wcmd(uchar)。void delay(uchar)。sbit rw = P0^6。} endififndef _LCD1602_Hdefine _LCD1602_Hinclude include define uchar unsigned chartypedef bit BOOL 。 break。i17。 } l_keyold=key。 return。 } j=_crol_(j,1)。0xf0)!=0xf0){ //如果有鍵按下,P1高4位不會全為1, key=P1。i++){ P1=j。 //設定初值 for (i=0。 j=0xfe。 //做為按鍵松開否的憑證 void ReadKey(void)。//鍵盤的讀取,我們采用分時掃描unsigned char l_key=0xff。 TI=0。 } SBUF=sms3。 TI=0。) { SBUF=sms[k]。 while(sms[k]!=39。 j++。 while(!TI)。\039。 } longdelay(10)。 TI=0。) { SBUF=sms1[i]。 while(sms1[i]!=39。 //InitCom()。TR1 = 1。TL1 = THTL。 //串口方式1,TMOD = 0x20。ET1=0。//初始化串行口void InitCom(void){uchar THTL。void InitCom(void)。uchar sms2[]={AT+CMGS=13760727792\r}。 delay(20)。 //然后寫入數(shù)據(jù) I2C_ACK(1)。 //寫入地址 I2C_ACK(0)。 //先向總線發(fā)出寫24C02的地址 I2C_ACK(0)。}void _24C02Write(unsigned char dat,unsigned char l_address){ I2C_start()。 //讀取一個地址的數(shù)據(jù)結束 delay(20)。 I2C_ACK(1)。 I2C_ACK(0)。 I2C_start()。//先寫入地址, I2C_ACK(1)。 //向I2C總線發(fā)出讀取24C02的地址 I2C_ACK(0)。 I2C_start()。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 SCL=0。_nop_()。_nop_()。 SCL=1。_nop_()。_nop_()。 }void I2C_ACK(bit tmp) //根據(jù)tmp的0來決定應答信號{ SDA=tmp。 } SCL=0。 tmp=1。_nop_()。_nop_()。 SCL=1。_nop_()。_nop_()。 //加入空指令增加穩(wěn)定性,這關系到頻率問題 SDA=1。 _nop_()。i++){ SCL=0。 for(i=0。}unsigned char I2C_read(void)////I2C讀取一個8位二進制數(shù),也是高位在前低位在后{ unsigned char i,tmp。_nop_()。_nop_()。 _nop_()。_nop_()。_nop_()。 _nop_()。0x80)。 _nop_()。 _nop_()。i8。 //24C02寫函數(shù)void I2C_write(unsigned char tmp)//I2C寫入一個8位二進制數(shù),高位在前低位在后{ unsigned char i。 //AT24C02串行時鐘 unsigned char _24C02Read(unsigned char l_address)。 }}define _at24c02_Hinclude include include define W24C02 0xA0 //存儲器的寫地址define R24C02 0xA1 //存儲器的讀地址sbit SDA=P3^7。 gsm(sms)。 display(0x00,Alarm!)。 if(int1==0) { speaker=0。 } }}void steal() interrupt 2{ code uchar sms[]={Alarm! Someone has interrupt your house!}。 } } else //密碼不正確 { times++。 break。 lcd_wcmd(0x01)。 display(0x00,Correct!)。 times=0。i++) //輸入密碼與實際密碼比較 correct_old=pswd[i]pswd_flash[i]+correct_old。 for(i=0,correct_old=0。 delay(200)。i6。 longdelay(10)。 //lcd初始化 display(0x00,Please input the)。,0x00)。 _24C02Write(39。139。,0x02)。 _24C02Write(39。339。,0x04)。 // 寫入初始密碼012345 _24C02Write(39。539。 times=0。 EX1=1。 EX0=1。 // while(1)。 } }}void main(){ InitCom()。 EA=0。 display(0x40,tem.)。 if(l_key==15) //關閉防盜系統(tǒng) { lcd_wcmd(0x01)。 EA=1。 EX0=1。 display(0x00,System startup.)。 } }void alarm_f(void){ l_key=0xff。 } } else //舊密碼不正確 { times++。 } else //新密碼不正確 { times++。 longdelay(10)。 display(0x00,Establishes succ)。i++) _24C02Write(pswd_new[i],0x00+i)。 for(i=0。 if(correct_new==0) //新密碼正確,修改密碼成功 { speaker=1。i6。 input()。 display(0x00,Input it again!)。i++) pswd_new[i]=pswd[i]。 for(i=0。 longdelay(10)。 display(0x00,Input new passwo)。 times=0。i++) correct_old_change=pswd[i]pswd_flash[i]+correct_old_change。 for(i=0,correct_old_change=0。 longdelay(10)。 display(0x00,Input old passwo)。 break。 break。 } else if(l_key==11) //修改密碼 { l_key=0xff。 l_key=0xff。 longdelay(10)。 display(0x00,Open the door.)。 while(1) { ReadKey()。}void function(void){ display(0x00,Please press the)。j++) 。j++) //自鎖 for(j=0。 for(j=0。 display(0x00,Try it tomorrow!)。 longdelay(10)。 lcd_wcmd(0x01)。 speaker=0。 } }}void pswd_error(void){ code uchar sms[]={Alarm! someone has inputed wrong password three times.}。 l_key=0xff。 } } while(k=6) { ReadKey()。 display(0x00+k, )。 } if(l_key==12) // 刪除 { delect=1。 l_key=0xff。 if(l_key=9) //輸入數(shù)字09 { pswd[k]=l_key+0x30。 lcd_wcmd(0x01)。 } } ES = 1。 //將接收到的字符串存到緩存中 First_Int++。 //清除發(fā)送中斷標志位 } if(RI) //如果是接送中斷,則進行處理 { RI = 0。 //開啟定時器0}//串口1中斷處理函數(shù)void Serial_Int(void) interrupt 4 { ES = 0。 //設置溢出一次為50ms TL0 = 0x00。 Times = 0。 } if(Timer0_Start == 1) Times++。
點擊復制文檔內容
職業(yè)教育相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1