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

正文內(nèi)容

基于51單片機(jī)的密碼鎖(可改密碼(編輯修改稿)

2024-12-13 22:15 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 88,1. [10] 戴佳 , 戴衛(wèi)恒 .C 語(yǔ)言應(yīng)用程序設(shè)計(jì) [M].電子工業(yè)出版社, 2020,1. [11] 龔運(yùn)新 . 單片機(jī) C 語(yǔ)言開(kāi)發(fā)技術(shù) [M].清華大學(xué)出版社 2020,1. 16 附 錄 附錄 1 總原理圖 (T2)1(T2EX)2345678RESET9(RXD)10(TXD)11(INT0)12(INT1)13(T0)14(T1)15(WR)16(RD)17XTAL218XTAL119GND20(A0)21(A1)22(A2)23(A3)24(A4)25(A5)26(A6)27(A7)28PSEA29ALE30EA31(AD7)32(AD6)33(AD5)34(AD4)35(AD3)36(AD2)37(AD1)38(AD0)39VCC40U1AT89C51123456781615141312111094K7RP1Res Pack4S?SWPBS?SWPBS?SWPBS?SWPBS?SWPBS?SWPBS?SWPBS?SWPBS?SWPBS?SWPBS?SWPBS?SWPBS?SWPBS?SWPBS?SWPBS?SWPB12XXTAL1161KR?ARes Pack21 161KARes Pack2Q?PNPD?Photo Sen30pFC2Cap30pFC1Cap10uFC3Cap Pol1S1SWPBVSS1VDD2VEE3RS4RW5E6D07D18D29D310D411D512D613D714====CODED LOCK===*LCD_1602LS?Bell12345K?RelayABCD1 2 3 4ABCD1234GNDD0D1D2D3D4D5D7D61KR1Res TapGNDGNDVCCVCCGNDVCCVCCGNDVCCVCCVCCGNDGND1KR?Res2VCCA01A11A23GND4SDA5SCL6WP7VCC8*AT24C02GNDVCC 附錄 2 源程序 源程序 include include define LCM_Data P0 define uchar unsigned char define uint unsigned int //define Busy 0x80 //用于檢測(cè) LCM 狀態(tài)字中的 Busy 標(biāo)識(shí) define w 6 //定義密碼位數(shù) 17 sbit lcd1602_rs=P2^5。 sbit lcd1602_rw=P2^6。 sbit lcd1602_en=P2^7。 sbit Scl=P3^4。 //24C02 串行時(shí)鐘 sbit Sda=P3^5。 //24C02 串行數(shù)據(jù) sbit ALAM = P2^1。 //報(bào)警 sbit KEY = P2^0。 //開(kāi)鎖 sbit open_led=P2^2。 //開(kāi)鎖指示燈 bit operation=0。 //操作標(biāo)志位 bit pass=0。 //密碼正確標(biāo)志 //bit ResetEn=0。 //重設(shè)密碼充許標(biāo)志 bit ReInputEn=0。 //重置輸入充許標(biāo)志 bit s3_keydown=0。 //3 秒按鍵標(biāo)志位 bit key_disable=0。 //鎖定鍵盤(pán)標(biāo)志 unsigned char countt0,second。 //t0 中斷計(jì)數(shù)器 ,秒計(jì)數(shù)器 void Delay5Ms(void)。 unsigned char code a[]={0xFE,0xFD,0xFB,0xF7}。 //控盤(pán)掃描控制表 unsigned char code start_line[]={password: }。 unsigned char code name[]={===Coded Lock===}。 //顯示名稱 unsigned char code Correct[]= { correct }。//輸入正確 unsigned char code Error[]={ error }。 //輸入錯(cuò)誤 unsigned char code codepass[] ={ pass }。 unsigned char code LockOpen[] ={ open }。 //OPEN unsigned char code SetNew[]= {SetNewWordEnable}。 unsigned char code Input[]= {input: }。 //INPUT unsigned char code ResetOK[]= {ResetPasswordOK }。 unsigned char code initword[] = {Init password...}。 unsigned char code Er_try[]= {error,try again!}。 unsigned char code again[]= {input again }。 unsigned char InputData[6]。 //輸入密碼暫存區(qū) unsigned char CurrentPassword[6]={1,3,1,4,2,0}。 //當(dāng)前密碼值 18 unsigned char TempPassword[6]。 unsigned char N=0。 //密碼輸入位數(shù)記數(shù) unsigned char ErrorCont。 //錯(cuò)誤次數(shù)計(jì)數(shù) unsigned char CorrectCont。 //正確輸入計(jì)數(shù) unsigned char ReInputCont。 //重新輸入計(jì)數(shù) unsigned char code initpassword[6]={0,0,0,0,0,0}。 //=====================5ms 延時(shí) ============================== void Delay5Ms(void) { unsigned int TempCyc = 5552。 while(TempCyc)。 } //===================400ms 延時(shí) ============================== void Delay400Ms(void) { unsigned char TempCycA = 5。 unsigned int TempCycB。 while(TempCycA) { TempCycB=7269。 while(TempCycB)。 } } //============================24C02============================ void mDelay(uint t) //延時(shí) { uchar i。 while(t) { for(i=0。i125。i++) {。} } } void Nop(void) //空操作 { _nop_()。 _nop_()。 19 _nop_()。 _nop_()。 } /*起始條件 */ void Start(void) { Sda=1。 Scl=1。 Nop()。 Sda=0。 Nop()。 } /*停止條件 */ void Stop(void) { Sda=0。 Scl=1。 Nop()。 Sda=1。 Nop()。 } /*應(yīng)答位 */ void Ack(void) { Sda=0。 Nop()。 Scl=1。 Nop()。 Scl=0。 } /*反向應(yīng)答位 */ void NoAck(void) { Sda=1。 Nop()。 Scl=1。 Nop()。 Scl=0。 } 20 /*發(fā)送數(shù)據(jù)子程序, Data 為要求發(fā)送的數(shù)據(jù) */ void Send(uchar Data) { uchar BitCounter=8。 uchar temp。 do { temp=Data。 Scl=0。 Nop()。 if((tempamp。0x80)==0x80) Sda=1。 else Sda=0。 Scl=1。 temp=Data1。 Data=temp。 BitCounter。 } while(BitCounter)。 Scl=0。 } /*讀一字節(jié)的數(shù)據(jù),并返回該字節(jié)值 */ uchar Read(void) { uchar temp=0。 uchar temp1=0。 uchar BitCounter=8。 Sda=1。 do{ Scl=0。 Nop()。 Scl=1。 Nop()。 if(Sda) temp=temp|0x01。 else temp=tempamp。0xfe。 if(BitCounter1) { 21 temp1=temp1。 temp=temp1。 } BitCounter。 } while(BitCounter)。 return(temp)。 } void WrToROM(uchar Data[],uchar Address,uchar Num) { uchar i。 uchar *PData。 PData=Data。 for(i=0。iNum。i++) { Start()。 Send(0xa0)。 Ack()。 Send(Address+i)。 Ack()。 Send(*(PData+i))。 Ack()。 Stop()。 mDelay(20)。 } } void RdFromROM(uchar Data[],uchar Address,uchar Num) { uchar i。 uchar *PData。 PData=Data。 for(i=0。iNum。i++) { Start()。 Send(0xa0)。 Ack()。 Send(Address+i)。 Ack()。 Start()。 Send(0xa1)。 Ack()。 22 *(PData+i)=Read()。 Scl=0。 NoAck()。 Stop()。 } } //============================LCD1602=================== define yi 0x80 //LCD 第一行的初始位置 ,因?yàn)?LCD1602 字符地址首位 D7 恒定為 1( 100000000=80) define er 0x80+0x40 //LCD 第二行初始位置(因?yàn)榈诙械谝粋€(gè)字符位置地址是 0x40) //延時(shí)函數(shù),后面經(jīng)常調(diào)用 void delay(uint xms)//延時(shí)函數(shù),有參函數(shù) { uint x,y。 for(x=xms。x0。x)
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1