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

正文內(nèi)容

基于單片機(jī)的萬(wàn)年歷制作(存儲(chǔ)版)

  

【正文】 TimeDateString[8] = 39。 } week_value[1] = 39。039。:39。 39。 39。 //寫入允許 Write1302(0x8c,0x07)。 //禁止寫入 }}/***********ds18b20子程序*************************//***********ds18b20延遲子函數(shù)(晶振12MHz )*******/ void delay_18B20(unsigned int i){ while(i)。 x=DQ。 DQ = 1。 DQ = datamp。 Init_DS18B20()。 a=ReadOneChar()。039。icount。i62。 //寫入允許 Write1302(0x80,Secondamp。 switch(count) {case 1: temp=Read1302(DS1302_SECOND)。 //分?jǐn)?shù)加1 up_flag=1。 case 4: temp=Read1302(DS1302_WEEK)。 if(temp0x31) temp=1。 //讀取年數(shù) temp=temp+1。 if(Down==0||wireless_3==1) { mdelay(8)。 //分?jǐn)?shù)減1 down_flag=1。 case 4: temp=Read1302(DS1302_WEEK)。 if(temp==0) temp=31。 //讀取年數(shù) temp=temp1。 if(Set==0||wireless_4==1) { mdelay(8)。 Write1302(0x80,temp|0x80)。 //寫入允許 Write1302(0x80,temp|0x80)。break。 //寫入新的分?jǐn)?shù) Write1302(0x8e,0x80)。 case 3:do //count=3,調(diào)整小時(shí) { hide_min=0。 down_flag=0。 Upkey()。 if(hide_week3) hide_week=0。 if(up_flag==1||down_flag==1) { Write1302(0x8e,0x00)。 }while(count==6)。 //寫入新的月數(shù) Write1302(0x8e,0x80)。 case 7:do //count=7,調(diào)整年 { hide_month=0。 down_flag=0。 //count8, 跳出調(diào)整模式,返回默認(rèn)顯示狀態(tài) Second=Read1302(DS1302_SECOND)。 }}void show_time() //液晶顯示程序{ DS1302_GetTime(amp。 //溫度數(shù)據(jù)轉(zhuǎn)換成液晶字符 GotoXY(12,1)。 //顯示星期 GotoXY(11,0)。 down_flag=0。 //液晶顯示數(shù)據(jù) flag=0。 while(1) { while(done==1) keydone()。 //DS18B20初始化 Initial_DS1302()。 //顯示日期 GotoXY(15,0)。 //日期數(shù)據(jù)轉(zhuǎn)換液晶字符 ReadTemp()。 break。 case 8: count=0。 //寫入新的年數(shù) Write1302(0x8e,0x80)。 }while(count==7)。 if(up_flag==1||down_flag==1) { Write1302(0x8e,0x00)。 if(hide_day3) hide_day=0。 Upkey()。 down_flag=0。 case 4:do //count=4,調(diào)整星期 { hide_hour=0。 //寫入新的小時(shí)數(shù) Write1302(0x8e,0x80)。 }while(count==3)。 if(up_flag==1||down_flag==1) { Write1302(0x8e,0x00)。 show_time()。 //掃描加按鈕 Downkey()。 if(flag==0) //關(guān)閉時(shí)鐘,停止計(jì)時(shí) { Write1302(0x8e,0x00)。 while(wireless_3==1)。 break。 //讀取日數(shù) temp=temp1。 if(temp==1) temp=0x23。 case 2: temp=Read1302(DS1302_MINUTE)。 while(wireless_2==1)。 break。 //讀取日數(shù) temp=temp+1。 if(temp0x23) //超過(guò)23小時(shí),清零 temp=0。 case 2: temp=Read1302(DS1302_MINUTE)。 }}////////////////////////////////////////////////////////////////////////////////////////////////////////////void Upkey()//升序按鍵{ Up=1。 Second=Read1302(DS1302_SECOND)。delay0。}void Delay1ms(unsigned int count){ unsigned int i,j。039。 //跳過(guò)讀序號(hào)列號(hào)的操作 WriteOneChar(0xBE)。 unsigned char b=0。 i0。i) { DQ = 0。 //精確延時(shí) 大于 480us DQ = 1。 Write1302(0x80,0x55)。 if(Secondamp。039。 39。 39。 ,判斷結(jié)束字符}void TimeToStr(SYSTEMTIME *Time) //將時(shí),分,秒數(shù)據(jù)轉(zhuǎn)換成液晶顯示字符放到數(shù)組 TimeString[]。 //星期的數(shù)據(jù)另外放到 week_value[]數(shù)組里,跟年,月,日的分開存放,因?yàn)榈纫幌乱谧詈箫@示 } else { week_value[0] = 39。 TimeDateString[9] = TimeDay%10 + 39。 } else { TimeDateString[5] = 39。 TimeDateString[3] = 39。 TimeDateString[3] = TimeYear%10 + 39。0x70)4)*10 + (ReadValueamp。0x70)4)*10 + (ReadValueamp。0x70)4)*10 + (ReadValueamp。0x70)4)*10 + (ReadValueamp。 DS1302InputByte(ucAddr|0x01)。 DS1302InputByte(ucAddr)。 i) { ACC = ACC 1。 i0。 unsigned char Year。) { LCD_Write(LCD_DATA,*str)。 //8位數(shù)據(jù)端口,2行顯示,5*7點(diǎn)陣 LCD_Write(LCD_COMMAND,0x38)。 _nop_()。 return DBPort。sbit LcdEn = P2^7。 //減法按鈕sbit out = P2^3。sbit wireless_3 = P3^2。四、 總結(jié)串行時(shí)鐘芯片DS1302連線簡(jiǎn)單、體積小、價(jià)格低,再為控制其系統(tǒng)中應(yīng)用有著突出的優(yōu)點(diǎn)。在本系統(tǒng)中,以ATmega為主器件,DS1302為從器件,RST接在主器件的PC4/TD0上,此引腳為高位的時(shí)候,選中該芯片,對(duì)其進(jìn)行操作。在控制字指令輸入后的下一個(gè)SCLK時(shí)鐘上升沿時(shí),數(shù)據(jù)被寫入DS1302,數(shù)據(jù)輸入從最低位(0位)開始。定義如下:當(dāng)BIT6位=0時(shí),定義時(shí)鐘和其他寄存器的地址。芯片為8引腳小型DIP封裝,引腳排列如圖一所示,引腳功能見(jiàn)表一。故而從性價(jià)比和貨源上考慮,本設(shè)計(jì)采用實(shí)時(shí)時(shí)鐘芯片DS1302。每種芯片的主要功能基本相同,只是在引腳數(shù)量、備用電池的安裝方
點(diǎn)擊復(fù)制文檔內(nèi)容
醫(yī)療健康相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1