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

正文內(nèi)容

基于單片機的密碼鎖設計_課程設計報告-預覽頁

2025-08-09 19:23 上一頁面

下一頁面
 

【正文】 DS1302 DS1302 是 DALLAS 公司推出的涓流充電時鐘芯片 ,內(nèi)含有一個實時時鐘 /日歷和 31 字節(jié)靜態(tài) RAM,通過簡單的串行接口與單片機進行通信實時時鐘 /日歷電路 .提供秒分時日日期 .月年的信息 ,每月的天數(shù)和閏年的天數(shù)可自動調(diào)整時鐘操作可通過 AM/PM 指示決定采用 24 或12 小時格式 .DS1302 與單片機之間能簡單地采用同步串行的方式進行通信 ,僅需用到三個口線 :1 RES 復位 ,2 I/O 數(shù)據(jù)線 ,3 SCLK 串行時鐘 .時鐘 /RAM 的讀 /寫數(shù)據(jù)以一個字節(jié)或多達 31 個字節(jié)的字符組方式通信 . DS1302 的引腳功 能排列及描述如下所示 . 圖 39 AT24C02 引腳圖 第 5 頁 管腳描述 : X1 X2 晶振管腳 GND 地 RST 復位腳 I/O 數(shù)據(jù)輸入 /輸出引腳 SCLK 串行時鐘 Vcc1,Vcc2 電源供電管腳 LCD12864 液晶 帶中文字庫的 128X64 是一種具有 4 位 /8 位并行、 2 線或 3 線串行多 種接口方式,內(nèi)部含有國標一級、二級簡體 中文字庫的點陣圖形液晶顯示模塊;其顯示分辨率為 128 64, 內(nèi)置 8192 個 16*16 點漢字,和 128 個 16*8 點 ASCII 字符 集 .利用該模塊靈活的接口方式和簡單、方便的操作指令,可構成全中文人機交互圖形界面。首先是選擇功能, 選擇萬年歷或者密碼鎖功能。當修改密碼時舊密碼輸入錯誤或兩遍新密碼輸入不相同時都會提示改密不成功,并且蜂鳴器響起。按鍵 E 為確認鍵,輸入密碼的過程中,當輸入的數(shù)夠六位以后,按下該鍵確認即可。 密碼存儲模塊 A01A12A23GND4V C C5WP6S C L7S D L8U3A T 24 C 0 2V C CR95 .1 k R 1 05 .1 kV C CP 3. 5P 3. 6P 3. 7 本次設計用 9012 型號三極管來驅(qū)動蜂鳴器。 ,經(jīng)用萬用表檢測后,發(fā)現(xiàn)任一按鍵當按下時,連接行的四個端口均全部置 0. 不能讀出相應鍵值。兩個調(diào)試時都是分別獨立調(diào)試的。只要去做,只要去學,只要肯下功夫?qū)W,沒有完不成的事!別人做的我們一樣能做。這都是很重要收獲。 while(1) { system_start()。 uchar read_password[6]。 _nop_()。 SCL=1。 delaynp()。 } void stop() //終止信號 { SCL=0。 delaynp()。 flag=0。 } void writebyte(uchar temp) //寫一個字節(jié) { uchar count=8。0x80)==0x80) SDA=1。 delaynp()。 uchar byte,rebyte。 SCL=1。0xfe。 } return(rebyte)。 while(flag)。 writebyte(temp)。 delayms(50)。 //偽寫 check()。 while(flag)。 while(flag)。 stop()。 uchar *p。i++) { wrtorom(addr+i,*(p+i))。 for(i=0。 第 18 頁 writepage(0,original_password,6)。 //sbit dula=P2^6。i0。 } void writecmd(uchar cmd) //寫命令 { RS=0。 delayms(5)。 } void writedat(uchar dat) //寫數(shù)據(jù) { RS=1。 delayms(5)。 } void lcd_pos(uchar X,uchar Y) 第 19 頁 { uchar pos。 else if(X==3) X=0x98。 while(*p) { writedat(*p)。 delayms(10)。 delayms(5)。 void delayms(unsigned int xms)。 temp=tempamp。 switch(temp) { case 0xee:key=0。 case 0xbe:key=2。 } while(temp!=0xf0) //等待按鍵釋放 { temp=P1。 } } P1=0xfd。 if(temp!=0xf0) { delayms(10)。 case 0xdd:key=5。 case 0x7d:key=7。0xf0。 temp=tempamp。 switch(temp) { case 0xeb:key=8。 case 0xbb:key=10。 } while(temp!=0xf0) { temp=P1。 } } P1=0xf7。 if(temp!=0xf0) { delayms(10)。 case 0xd7:key=13。 case 0x77:key=15。0xf0。 temp=P1。 uchar table2[]=I2C 密碼鎖 。 //s=P20。 // e=P22。 // SCLK=P1^0。 // RST =P1^2。 for(i=0。 for(i=0。j)。 for(i=0。 delaynus(2)。 dat=1。 delaynus(2)。 RST=0。 for(i=0。 SCLK=1。 } return dat。 RST=1。 RST=0。 if(flagamp。 //根據(jù)寫分寄存器命令字,寫入分的初始值 writeset1302(0x84,((21/10)4|(21%10)))。 //根據(jù)寫年寄存器命令字,寫入年的初始值 writeset1302(0x8a,((4/10)4|(4%10)))。 rs=0。 delayms(1)。 rs=1。 delayms(1)。 write_12864(0x30)。 第 27 頁 write_12864(0x0c)。 write_12864(0x06)。 j=x%10。 write_12864dat(digit[j])。 j=x%10。 delaynus(5)。 第 28 頁 write_12864(0x9a)。 } /************************************************************************ 函數(shù)功能: 在液晶上顯示日位 *******************************************************************************/ void displayday(uchar x) { uint i,j。 write_12864dat(digit[i])。 i=x/10。 write_12864dat(digit[j])。 j=x%10。 delaynus(5)。 write_12864(0x98)。n++) { write_12864dat(table8[n])。 write_12864(0x80)。 delaynus(50)。i++) { write_12864dat(table2[i])。i2。 //月 for(i=2。 } write_12864(0x8f)。 delaynus(50)。i++) { write_12864dat(table3[i])。i10。 //秒 for(i=10。 } write_12864(0x88)。 第 31 頁 delaynus(50)。 //分別儲存苗、分、小時,日,月,年 uchar valuedat。 while(key==11) { valuedat=readset1302(0x81)。 displaysecond(second)。0x0f)。0x70)4)*10+(valuedatamp。//在寄存器讀日數(shù)據(jù) day=((valuedatamp。 valuedat=readset1302(0x89)。 displaymonth(month)。0x0f)。0xf0)4)*10+(valuedatamp。 if(key!=11) { writecmd(0x01) 。 sbit beep=P3^7。 uchar fail_count。 void password_enter()。 void input_key()。 void password_back() //退格 第 33 頁 { if(j=0) { if(j==0) password_save[0]=39。 lcd_dis(2,j, )。i++) { if(password_save[i]!=read_password[i]) { enter_flag=0。 fail_count=0。 for(i=0。 } } void password_error() //密碼錯誤 { 第 34 頁 fail_count++。 else if(fail_count==2) lcd_dis(1,0,還有一次機會 )。 if(enter_flag) { password_right()。 } } else if(fail_count==3) { fail_count=0。 speaker()。 j=0。amp。 lcd_dis(2,j,*)。 } if(key==15) { password_back()。 led=1。 lcd_dis(1,0,請輸入舊密碼: )。 if(enter_flag) { enter_flag=0。 input_key()。 j=0。 input_key()。 writecmd(0x01)。 key_function()。 delayms(3000)。 lcd_dis(1,0,密碼錯誤?。?! )。 system_start()。 if(key==13) { writecmd(0x01)。 lcd_dis(0,0,....歡迎使用 ....)。 //writepage(0,original_password,6)。 } if(key==10) { led1=1。 input_key()。 delayms(300)。 }
點擊復制文檔內(nèi)容
研究報告相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1