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

正文內(nèi)容

基于單片機語音智能密碼鎖設(shè)計-閱讀頁

2024-09-18 17:43本頁面
  

【正文】 unt6)。lcd_x=0。 lcd_clr()。 i = 0。\039。 i++。 i = 0。\039。 i++。 write_nbyte(0xa0,0x00,code_buf,6)。 lcd_clr()。 i = 0。\039。 i++。 i = 0。\039。 i++。 for(j=0。j++) 37 { lcd_wcmd((0x44+j)|0x80)。 } } void main() { uchar i。 start: Delay_ms(10)。 I2C_init()。 i = 0。\039。 i++。 i = 0。\039。 i++。 if(P1!=0xf0) 38 { MatrixKey()。 if(key==0x0d)ReadCode()。 } } } 密碼鎖工作程序 include include include include define uchar unsigned char define uint unsigned int uchar code_buf[6]。 uchar key。 sbit BEEP=P3^7。//繼電器 uchar count_5ms,sec。 bit flag_p=0。 。 。 //重新輸入密碼 const uchar chongse[]=G 請輸入新密碼。 //重新設(shè)定密碼 //const uchar suoding[]=G 請稍后再試。//三次后鎖定 void beep() // 蜂鳴器響聲 39 { BEEP=0。 BEEP=1。 } /*********串口發(fā)送一個字節(jié) ************/ /*void Uart_SendChar(unsigned char dat) { SBUF = dat。 //等待發(fā)送完成 TI = 0。 while(trdata[i]!=0x00) { SBUF=trdata[i]。 TI=0。 } } void MatrixKey()//矩陣鍵盤掃描 { 40 P1=0xff。 temp=P1。 0x0f。 temp=P1。 0x0f。 switch(temp) { case 0xee:key=0。 case 0xed:key=1。 case 0xeb:key=2。 case 0xe7:key=3。 } temp=P1。 temp=temp amp。 while(temp!=0x0f) { temp=P1。 0x0f。 41 P1=0xdf。 temp=temp amp。 if (temp!=0x0f) { Delay_ms(10)。 temp=temp amp。 if (temp!=0x0f) { temp=P1。break。break。break。break。 beep()。 0x0f。 temp=temp amp。 } } } P1=0xff。 42 temp=P1。 0x0f。 temp=P1。 0x0f。 switch(temp) { case 0xbe:key=8。 case 0xbd:key=9。 case 0xbb:key=10。 case 0xb7:key=11。 } temp=P1。 temp=temp amp。 while(temp!=0x0f) { temp=P1。 0x0f。 P1=0x7f。 43 temp=temp amp。 if (temp!=0x0f) { Delay_ms(10)。 temp=temp amp。 if (temp!=0x0f) { temp=P1。break。break。break。break。 beep()。 0x0f。 temp=temp amp。 } } } } /************開機顯示畫面 *******************/ uchar code line1_data[] = { KEY LOCK }。 44 /************密碼輸入畫面 *******************/ uchar code in_line1[] = { PLEASE INPUT }。 /************密碼輸入正確畫面 *******************/ uchar code inok_line1[] = {INPUT PASSWORD }。 /************密碼輸入錯誤畫面 *******************/ uchar code inerr_line1[] = {INPUT PASSWORD }。 /************修改密碼畫面 *******************/ uchar code modify_line1[] = {MODIFY PASSWORD }。 /************密碼修改成功畫面 *******************/ uchar code setok_line1[] = {MODIFY PASSWORD }。 /********以下是開機畫面顯示函數(shù) ********/ void StartDisp() { uchar i。 lcd_wcmd(0x00|0x80)。 while(line1_data[i] != 39。) { lcd_wdat(line1_data[i])。 } lcd_wcmd(0x40|0x80)。 while(line2_data[i] != 39。) 45 { lcd_wdat(line2_data[i])。 } } /********以下是密碼輸入畫面顯示函數(shù) ********/ void CodeInDisp() { uchar i。 lcd_wcmd(0x00|0x80)。 while(in_line1[i] != 39。) { lcd_wdat(in_line1[i])。 } lcd_wcmd(0x40|0x80)。 while(in_line2[i] != 39。) { lcd_wdat(in_line2[i])。 } } /********以下是密碼輸入錯誤顯示函數(shù) ********/ void CodeInErr() { uchar i。 46 lcd_wcmd(0x00|0x80)。 while(inerr_line1[i] != 39。) { lcd_wdat(inerr_line1[i])。 } lcd_wcmd(0x40|0x80)。 while(inerr_line2[i] != 39。) { lcd_wdat(inerr_line2[i])。 } } /********以下是密碼輸入正確顯示函數(shù) ********/ void CodeInOk() { uchar i。 lcd_wcmd(0x00|0x80)。 while(inok_line1[i] != 39。) { lcd_wdat(inok_line1[i])。 } lcd_wcmd(0x40|0x80)。 while(inok_line2[i] != 39。) 47 { lcd_wdat(inok_line2[i])。 } } /********以下是密碼設(shè)置畫面顯示函數(shù) ********/ void CodeSetDisp() { uchar i。 lcd_wcmd(0x00|0x80)。 while(modify_line1[i] != 39。) { lcd_wdat(modify_line1[i])。 } lcd_wcmd(0x40|0x80)。 while(modify_line2[i] != 39。) { lcd_wdat(modify_line2[i])。 } } /********以下是密碼設(shè)置成功畫面顯示函數(shù) ********/ void CodeSetOk() { uchar i。 48 lcd_wcmd(0x00|0x80)。 while(setok_line1[i] != 39。) { lcd_wdat(setok_line1[i])。 } lcd_wcmd(0x40|0x80)。 while(setok_line2[i] != 39。) { lcd_wdat(setok_line2[i])。 } } void PassIn() { static uchar lcd_x=0。 //密 碼計數(shù)器,注意是靜態(tài)局部變量 static uchar code_n=0。 //清屏 RELAY=1 。 //密碼輸入畫面 do{ P1=0xf0。//鍵盤掃描 P1=0xf0。 if((key=0)amp。(key=9)) //09有效 其余無效 { incode_buf[count]=key。 lcd_wdat(0x2a)。 lcd_x++。 //密碼小于 6位 if(count=6){count=0。} if(memcmp(incode_buf,code_buf,6)==0)//memcmp判斷函數(shù),判斷密碼輸入是否正確 為‘ 0’正確 { Uart_SendString(rshuru)。 beep()。beep()。//設(shè)置標(biāo)志位 code_n=0。//繼電器開啟,模擬開鎖 } else if(memcmp(incode_buf,code_buf,6)!=0)//不為‘ 0’,錯誤 { Uart_SendString(eshuru)。 if(code_n=3) { 50 CodeInErr()。 code_n=0。 } } /*****************密碼設(shè)置函數(shù) *****************/ void PassSet() { static uchar lcd_x=0。 // 密碼計數(shù)器,注意是靜態(tài)局部變量 lcd_clr()。//開機顯示函數(shù) Uart_SendString(chongse)。 if(P1!=0xf0)//判斷是否有按鍵按下 { MatrixKey()。 while(P1!=0xf0)。amp。//存入鍵值 lcd_wcmd((0x49+lcd_x)|0x80)。 count++。 } 51 } }while(count6)。lcd_x=0。beep()。 Uart_SendString(rshuru)。 lcd_clr()。 } /**************主函數(shù) ****************/ void main() { TMOD=0x21。 //5ms 定時初值 TL0=0x00。 //開總中斷 ET0=1。 //串口工作方式為 1 , 串行允許接收 TR1 = 1。 //波特率 9600bps fosc=11.0592MHz TL1 = 0xfd。 //開串口中斷 Delay_ms(10)。 //液晶初始化 I2C_init()。//繼電器關(guān)閉 lcd_clr()。//開機畫面顯示 read_nbyte (0xa0,0x00,code_buf,6)。 while(P1==0xf0)。//鍵盤掃描 if(key!=0x0a)goto SCAN。 //語音播報密碼錯誤 TR0=1。 beep()。//若 2s到 ,則將 2s標(biāo)志位清 0 else goto SCAN。 //調(diào)用密碼輸入函數(shù) while(1) { if(flag_p==1) { MatrixKey()。 //調(diào)入密碼設(shè)置函數(shù) MatrixKey()。 //若按下了 E鍵 ,則跳轉(zhuǎn)到標(biāo)志 START處重新開始 } if(key==0x0e)goto START。 if(key==0x0e)goto START。TL0=0x00。 if(count_5ms==200) { count_5ms=0。 } if(sec==2) { flag_2s=1。 } }
點擊復(fù)制文檔內(nèi)容
高考資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1