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

正文內(nèi)容

基于at89c51單片機(jī)的電子萬(wàn)年歷的設(shè)計(jì)(參考版)

2025-06-27 22:56本頁(yè)面
  

【正文】 //啟動(dòng)定時(shí)器 while(1) { //如果未執(zhí)行調(diào)整操作則正常讀取當(dāng)前時(shí)間 if(Adjust_Index==1) GetTime()。 //裝入初始值,定時(shí)1秒 TL0=50000%256。 //外部中斷0為電平觸發(fā),低電平有效 TMOD=0x01。 //允許INT0,T0中斷,EA=1,ET0=1,EX0=1 IP=0x01。 } }}void main(){ Init_LCD()。 39。 39。 39。 if(K4==0){ SET_DS1302()。 } else if(K4==0) //確定 { //while(K4==0)。//while(K3==0)。 if(K2==0) DateTime_Adjust(1)。 } } else if(K2==0) //加 { //while(K2==0)。 //顯示調(diào)節(jié)對(duì)象 LCD_DSY_BUFFER2[15]=39。[39。 if(Adjust_Index==5) Adjust_Index=4。 if(Adjust_Index==1||Adjust_Index==1) { Adjust_Index=7。}//鍵盤中斷(INT0)//void EX_INT0() interrupt 0{ if(K1==0) //選擇調(diào)整對(duì)象(Y M D H M) { DelayMS(10)。 //顯示年月日,星期,時(shí)分秒 Display_LCD_String(0x00,LCD_DSY_BUFFER1)。 Format_DateTime(DateTime[1],LCD_DSY_BUFFER2+8)。 //星期strcpy(LCD_DSY_BUFFER1+13,WEEK[DateTime[5]1])。 Format_DateTime(DateTime[4],LCD_DSY_BUFFER1+8)。 tCount=0。 TL0=50000%256。 break。amp。DateTime[1]59) DateTime[1]++。 case 1: //分 if(x==1amp。DateTime[2]0) DateTime[2]。 if(x==1amp。amp。 break。DateTime[3]0) DateTime[3]。 if(x==1amp。amp。 case 3: //日002231,調(diào)節(jié)之前首先根據(jù)年份得出該年中二月的天數(shù) MonthsDays[2]=isLeapYear(2000+DateTime[6])?29:28。} RefreshWeekDay()。 MonthsDays[2]=isLeapYear(2000+DateTime[6])?29:28。amp。DateTime[4]12) DateTime[4]++。 case 4: //月0112 if(x==1amp。} RefreshWeekDay()。 //獲取2月天數(shù) MonthsDays[2]=isLeapYear(2000+DateTime[6])?29:28。amp。DateTime[6]99) DateTime[6]++。//*****年月日時(shí)分++/********//void DateTime_Adjust(char x){ switch(Adjust_Index) { case 6: //年0099 if(x==1amp。 } d+=DateTime[3]。iDateTime[4]。 } d=0。i++) { d=isLeapYear(i)?366:365。 // for(i=2000。y%100!=0)||(y%400==0)。}//判斷是否為閏年uchar isLeapYear(uint y){ return (y%4==0amp。 a[1]=d%10+39。 }}//日期與時(shí)間值轉(zhuǎn)換為數(shù)字字符//void Format_DateTime(uchar d,uchar *a){ a[0]=d/10+39。i++) { Write_LCD_Data(s[i])。 for(i=0。//相當(dāng)于在0x80基礎(chǔ)上加入位置量 }//在LCD上顯示字符串//void Display_LCD_String(uchar p,uchar *s){ uchar i。 //設(shè)置開(kāi)顯示,不顯示光標(biāo) DelayMS(1)。 //寫一個(gè)字符后地址指針自動(dòng)加1 DelayMS(1)。 //顯示清零,數(shù)據(jù)指針清零 DelayMS(1)。 //設(shè)置16*2顯示,5*7點(diǎn)陣,8位數(shù)據(jù)接口 DelayMS(1)。EN=0。EN=1。 RW=0。 RS=0。EN=0。EN=1。RW=0。 RS=1。 DelayMS(5)。} //忙等待//void LCD_Busy_Wait(){ while((Read_LCD_State()amp。DelayMS(1)。 state=P0。EN=1。 RS=0。i++){ DateTime[i]=Read_Data(0X81+2*i)。 for(i=0。 } Write_DS1302(0x8E,0x80)。i7。//寫控制字,取消寫保護(hù) Write_DS1302(0x8E,0x00)。RST=0。 Write_A_Byte_TO_DS1302(dat)。RST=1。 return dat。SCLK=1。 //RST高電平時(shí)讀/寫 Write_A_Byte_TO_DS1302(addr)。SCLK=0。 //返回BCD碼}//從DS1302指定位置讀數(shù)據(jù)//uchar Read_Data(uchar addr){ uchar dat。SCLK=0。i++){ b |= _crol_((uchar)IO,i)。 for(i=0。 //一個(gè)高脈沖將數(shù)據(jù)送入液晶控制器 x=1。 //每一位與1與存入IO中 SCLK=1。i++){ IO=xamp。 for(i=0。i++)。 while(ms)
點(diǎn)擊復(fù)制文檔內(nèi)容
物理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1