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

正文內(nèi)容

基于單片機(jī)的多功能萬年歷設(shè)計畢業(yè)設(shè)計論文-資料下載頁

2025-06-20 12:35本頁面
  

【正文】 } io_1302=CY。 clk_1302=0。 clk_1302=1。 } rst_1302=0。}/********讀1302函數(shù)********/uchar read_1302(uchar add){ uchar i,temp=0。 rst_1302=0。 clk_1302=0。 rst_1302=1。 for(i=0。i8。i++) // 寫入地址 { add=add1。 io_1302=CY。 clk_1302=0。 clk_1302=1。 } for(i=0。i8。i++) //讀取數(shù)據(jù) { clk_1302=1。 clk_1302=0。 if(io_1302) { temp=temp|(0x01i)。 } } temp=temp/16*10+temp%16。 //將數(shù)據(jù)由BCD碼轉(zhuǎn)換為十進(jìn)制 rst_1302=0。 return temp。 }void ds1302() //讀取寫入ds1302函數(shù){ if((tt==1)amp。amp。(set==0)) //當(dāng)退出時間設(shè)定時,首先將設(shè)定的時間寫入芯片*/ { tt=0。 write_1302(0x8e,0x00)。 //啟動讀寫 write_1302(0x82,min)。 write_1302(0x84,hour)。 write_1302(0x8a,week)。 write_1302(0x86,day)。 write_1302(0x88,mon)。 write_1302(0x8c,year)。 write_1302(0x8e,0x80)。 //禁止讀寫 } if(set==0) //沒有在設(shè)置狀態(tài)時讀取時鐘芯片數(shù)據(jù) { sec=read_1302(0x81)。 min=read_1302(0x83)。 hour=read_1302(0x85)。 week=read_1302(0x8b)。 day=read_1302(0x87)。 mon=read_1302(0x89)。 year=read_1302(0x8d)。 } if(set!=0) //設(shè)置時讀取秒數(shù)據(jù) { sec=read_1302(0x81)。 }}(2) MAX7219驅(qū)動函數(shù)//******MAX7219程序******//void MAX7219_1(uchar msb,uchar lsb){ uchar i。 cs_7219_1=0。 for(i=0。i16。i++) //寫入16位數(shù)據(jù) { if(i8) //數(shù)碼管位選 msb=msb1。 else //數(shù)碼管段選 lsb=lsb1。 clk_7219_1=0。 din_7219_1=CY。 _nop_()。 clk_7219_1=1。 } cs_7219_1=1。}(3) 陰歷計算函數(shù)/*函數(shù)功能:輸入十進(jìn)制陽歷數(shù)據(jù),輸出陰歷數(shù)據(jù)(只允許20002099年)調(diào)用函數(shù)示例:Conversion(year_sun,month_sun,day_sun)如:計算2015年4月16日Conversion(15,04,16)。year_sun,month_sun,day_sun均為十進(jìn)制數(shù)據(jù)調(diào)用函數(shù)后,原有數(shù)據(jù)不變,讀year_moon,month_moon,day_moon得出陰歷十進(jìn)制數(shù)據(jù)*/void Conversion(uchar year_sun,uchar month_sun,uchar day_sun){ uchar temp1,temp2,temp3,month_p。 uint temp4,table_addr。 bit flag2,flag_y。 //定位數(shù)據(jù)表地址 table_addr=year_sun*0x3。 //定位數(shù)據(jù)表地址完成 //取當(dāng)年春節(jié)所在的公歷月份 temp1=year_code[table_addr+2]amp。0x60。 temp1=_cror_(temp1,5)。 //取當(dāng)年春節(jié)所在的公歷月份完成 //取當(dāng)年春節(jié)所在的公歷日 temp2=year_code[table_addr+2]amp。0x1f。 //取當(dāng)年春節(jié)所在的公歷日完成 // 計算當(dāng)年春年離當(dāng)年元旦的天數(shù),春節(jié)只會在公歷1月或2月 if(temp1==0x1) { temp3=temp21。 } else { temp3=temp2+0x1f1。 } // 計算當(dāng)年春年離當(dāng)年元旦的天數(shù)完成 //計算公歷日離當(dāng)年元旦的天數(shù),為了減少運(yùn)算,用了兩個表 //day_code1[9],day_code2[3] //如果公歷月在九月或前,天數(shù)會少于0xff,用表day_code1[9], //在九月后,天數(shù)大于0xff,用表day_code2[3] //如輸入公歷日為8月10日,則公歷日離元旦天數(shù)為day_code1[81]+101 //如輸入公歷日為11月10日,則公歷日離元旦天數(shù)為day_code2[1110]+101 if (month_sun10) { temp4=day_code1[month_sun1]+day_sun1。 } else { temp4=day_code2[month_sun10]+day_sun1。 } if ((month_sun0x2)amp。amp。(year_sun%0x4==0)) { //如果公歷月大于2月并且該年的2月為閏月,天數(shù)加1 temp4+=1。 } //計算公歷日離當(dāng)年元旦的天數(shù)完成 //判斷公歷日在春節(jié)前還是春節(jié)后 if (temp4=temp3) { //公歷日在春節(jié)后或就是春節(jié)當(dāng)日使用下面代碼進(jìn)行運(yùn)算 temp4=temp3。 month_sun=0x1。 month_p=0x1。 //month_p為月份指向,公歷日在春節(jié)前或就是春節(jié)當(dāng)日month_p指向首月 flag2=get_moon_day(month_p,table_addr)。 //檢查該農(nóng)歷月為大小還是小月,大月返回1,小月返回0 flag_y=0。 if(flag2==0)temp1=0x1d。 //小月29天 else temp1=0x1e。 //大小30天 temp2=year_code[table_addr]amp。0xf0。 temp2=_cror_(temp2,4)。 //從數(shù)據(jù)表中取該年的閏月月份,如為0則該年無閏月 while(temp4=temp1) { temp4=temp1。 month_p+=1。 if(month_sun==temp2) { flag_y=~flag_y。 if(flag_y==0) month_sun+=1。 } else month_sun+=1。 flag2=get_moon_day(month_p,table_addr)。 if(flag2==0)temp1=0x1d。 else temp1=0x1e。 } day_sun=temp4+1。 } else { //公歷日在春節(jié)前使用下面代碼進(jìn)行運(yùn)算 temp3=temp4。 year_sun=1。 table_addr=0x3。 month_sun=0xc。 temp2=year_code[table_addr]amp。0xf0。 temp2=_cror_(temp2,4)。 if (temp2==0) month_p=0xc。 else month_p=0xd。 /*month_p為月份指向,如果當(dāng)年有閏月,一年有十三個月,月指向13,無閏月指向12*/ flag_y=0。 flag2=get_moon_day(month_p,table_addr)。 if(flag2==0)temp1=0x1d。 else temp1=0x1e。 while(temp3temp1) { temp3=temp1。 month_p=1。 if(flag_y==0)month_sun=1。 if(month_sun==temp2)flag_y=~flag_y。 flag2=get_moon_day(month_p,table_addr)。 if(flag2==0)temp1=0x1d。 else temp1=0x1e。 } day_sun=temp1temp3+1。 } year_moon=year_sun。 //輸出陰歷數(shù)據(jù) month_moon=month_sun。 day_moon=day_sun。}4
點擊復(fù)制文檔內(nèi)容
高考資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1