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

正文內(nèi)容

基于gsm的智能家居安全系統(tǒng)(已改無錯字)

2022-07-25 17:56:16 本頁面
  

【正文】 int t,j。 speaker=0。 t=times。 lcd_wcmd(0x01)。 display(0x00,Error!)。 longdelay(10)。 if(t=3) //錯誤輸入3次后自鎖 { lcd_wcmd(0x01)。 display(0x00,Try it tomorrow!)。 gsm(sms)。 for(j=0。j=0。j++) //自鎖 for(j=0。j=0。j++) 。 } return。}//////////////////////////功能選擇函數(shù)/////////////////////////////////////void function(void){ display(0x00,Please press the)。 display(0x40,function key)。 while(1) { ReadKey()。 if(l_key==10) //開門 { lcd_wcmd(0x01)。 display(0x00,Open the door.)。 door=0。 longdelay(10)。 door=1。 l_key=0xff。 break。 } else if(l_key==11) //修改密碼 { l_key=0xff。 change_f()。 break。 } else if(l_key==13) //啟動防盜系統(tǒng) { alarm_f()。 break。 } } }/////////////////////////////修改密碼函數(shù)////////////////////////////////void change_f(void){ lcd_wcmd(0x01)。 display(0x00,Input old passwo)。 display(0x40,rd:)。 longdelay(10)。 input()。 for(i=0,correct_old_change=0。i6。i++) correct_old_change=pswd[i]pswd_flash[i]+correct_old_change。 if(correct_old_change==0) //舊密碼正確,輸入新密碼 { speaker=1。 times=0。 lcd_wcmd(0x01)。 display(0x00,Input new passwo)。 display(0x40,rd:)。 longdelay(10)。 input()。 for(i=0。i=6。i++) pswd_new[i]=pswd[i]。 lcd_wcmd(0x01)。 display(0x00,Input it again!)。 longdelay(10)。 input()。 for(i=0,correct_new=0。i6。i++) correct_new=pswd[i]pswd_new[i]+correct_new。 if(correct_new==0) //新密碼正確,修改密碼成功 { speaker=1。 times=0。 for(i=0。i6。i++) _24C02Write(pswd_new[i],0x00+i)。//將新的六位密碼寫入E2PRAM,AT24C02 lcd_wcmd(0x01)。 display(0x00,Establishes succ)。 display(0x40,essful!)。 longdelay(10)。 change=0。 } else //新密碼不正確 { times++。 pswd_error()。 } } else //舊密碼不正確 { times++。 pswd_error()。 } }/////////////////////////////////報警功能函數(shù)//////////////////////////////////////void alarm_f(void){ l_key=0xff。 lcd_wcmd(0x01)。 display(0x00,System startup.)。 longdelay(10)。 EX0=1。 EX1=1。 EA=1。 while(1) { ReadKey()。 if(l_key==15) //關(guān)閉防盜系統(tǒng) { lcd_wcmd(0x01)。 display(0x00,Shutdown the sys)。 display(0x40,tem.)。 longdelay(10)。 EA=0。 break。 } }}////////////////////////////////////////主函數(shù)///////////////////////////////void main(){ InitCom()。 int1=0。 // while(1)。 IT0=1。 EX0=1。 IT1=1。 EX1=1。 EA=0。 times=0。 //錯誤次數(shù)清零 _24C02Write(39。539。,0x05)。 // 寫入初始密碼012345 _24C02Write(39。439。,0x04)。 _24C02Write(39。339。,0x03)。 _24C02Write(39。239。,0x02)。 _24C02Write(39。139。,0x01)。 _24C02Write(39。039。,0x00)。 while(1) { lcd_init() 。 //lcd初始化 display(0x00,Please input the)。 display(0x40,password:)。 longdelay(10)。 for(i=0。i6。i++) pswd_flash[i]=_24C02Read(0x00+i)。 delay(200)。 input()。 for(i=0,correct_old=0。i6。i++) //輸入密碼與實際密碼比較 correct_old=pswd[i]pswd_flash[i]+correct_old。 if(correct_old==0) //密碼正確 { speaker=1。 times=0。 lcd_wcmd(0x01)。 display(0x00,Correct!)。 longdelay(10)。 lcd_wcmd(0x01)。 while(1) { if(l_key==15) { l_key=0xff。 break。 } function()。 } } else //密碼不正確 { times++。 pswd_error()。 } }}///////////////////////////紅外傳感器中斷函數(shù)//////////////////////////////void steal() interrupt 2{ code uchar sms[]={Alarm! Someone has interrupt your house!}。 delay(200)。 if(int1==0) { speaker=0。 lcd_wcmd(0x01)。 display(0x00,Alarm!)。 display(0x40,Steal!)。 gsm(sms)。 EX1=0。 }}//////////////////////////////////AT24C02頭文件/////////////////////////////ifndef _at24c02_Hdefine _at24c02_Hinclude include include define W24C02 0xA0 //存儲器的寫地址define R24C02 0xA1 //存儲器的讀地址/********************/sbit SDA=P3^7。 //AT24C02串行數(shù)據(jù) sbit SCL=P3^6。 //AT24C02串行時鐘 unsigned char _24C02Read(unsigned char l_address)。 //24C02讀函數(shù)void _24C02Write(unsigned char dat,unsigned char l_address)。 //24C02寫函數(shù)void I2C_write(unsigned char tmp)//I2C寫入一個8位二進制數(shù),高位在前低位在后{ unsigned char i。 for(i=0。i8。i++){ SCL=0。 _nop_()。 _nop_()。 _nop_()。 SDA=(bit)(tmpamp。0x80)。 tmp=1。 _nop_()。_nop_()。_nop_()。_nop_()。_nop_()。 SCL=1。 _nop_()。_nop_()。_nop_()。_nop_()。_nop_()。 } SCL=0。}unsigned char I2C_read(void)////I2C讀取一個8位二進制數(shù),也是高位在前低位在后{ unsigned char i,tmp。 tmp=0。 for(i=0。i8。i++){ SCL=0。 _nop_()。 _nop_()。 _nop_()。 //加入空指令增加穩(wěn)定性,這關(guān)系到頻率問題 SDA=1。 _nop_()。_nop_()。_nop_()。_nop_()。_nop_()。 SCL=1。 _nop_()。_nop_()。_nop_()。_nop_()。_nop_()。 tmp=1。 if(SDA==1) tmp
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1