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

正文內(nèi)容

基于單片機的電子萬年歷設計-資料下載頁

2025-06-27 20:09本頁面
  

【正文】 for(i=8。 i0。 i){ACC = ACC 1。//相當于匯編中的 RRC ACC7 = DS1302_IO。DS1302_CLK = 1。DS1302_CLK = 0。} return(ACC)。 }void Write1302(unsigned char ucAddr, unsigned char ucDa)//ucAddr: DS1302地址, ucData: 要寫的數(shù)據(jù){DS1302_RST = 0。 DS1302_CLK = 0。 DS1302_RST = 1。 DS1302InputByte(ucAddr)。// 地址,命令 DS1302InputByte(ucDa)。 // 寫1Byte數(shù)據(jù) DS1302_CLK = 1。 DS1302_RST = 0。} unsigned char Read1302(unsigned char ucAddr)//讀取DS1302某地址的數(shù)據(jù){unsigned char ucData。 DS1302_RST = 0。 DS1302_CLK = 0。 DS1302_RST = 1。 DS1302InputByte(ucAddr|0x01)。// 地址,命令 ucData = DS1302OutputByte()。// 讀1Byte數(shù)據(jù) DS1302_CLK = 1。 DS1302_RST = 0。 return(ucData)。}void DS1302_GetTime(SYSTEMTIME *Time) //獲取時鐘芯片的時鐘數(shù)據(jù)到自定義的結構型數(shù)組{unsigned char ReadValue。ReadValue = Read1302(DS1302_SECOND)。TimeSecond = ((ReadValueamp。0x70)4)*10 + (ReadValueamp。0x0F)。ReadValue = Read1302(DS1302_MINUTE)。TimeMinute = ((ReadValueamp。0x70)4)*10 + (ReadValueamp。0x0F)。ReadValue = Read1302(DS1302_HOUR)。TimeHour = ((ReadValueamp。0x70)4)*10 + (ReadValueamp。0x0F)。ReadValue = Read1302(DS1302_DAY)。TimeDay = ((ReadValueamp。0x70)4)*10 + (ReadValueamp。0x0F)。ReadValue = Read1302(DS1302_WEEK)。TimeWeek = ((ReadValueamp。0x70)4)*10 + (ReadValueamp。0x0F)。ReadValue = Read1302(DS1302_MONTH)。TimeMonth = ((ReadValueamp。0x70)4)*10 + (ReadValueamp。0x0F)。ReadValue = Read1302(DS1302_YEAR)。TimeYear = ((ReadValueamp。0xf0)4)*10 + (ReadValueamp。0x0F)。}void Initial_DS1302(void) //時鐘芯片初始化{unsigned char Second=Read1302(DS1302_SECOND)。if(Secondamp。0x80)//判斷時鐘芯片是否關閉{Write1302(0x8e,0x00)。//寫入允許_nop_()。 _nop_()。 _nop_()。Write1302(0x8c,0x09)。//寫入年_nop_()。 _nop_()。 _nop_()。 Write1302(0x88,0x05)。//寫入月Write1302(0x86,0x05)。//寫入日Write1302(0x8a,0x02)。//星期Write1302(0x84,0x23)。//時Write1302(0x82,0x59)。//寫入分Write1302(0x80,0x30)。//寫入秒Write1302(0x90,0xae)。//開啟充電_nop_()。 _nop_()。 _nop_()。 Write1302(0x8e,0x80)。//禁止寫入}}LCD12864程序include define uchar unsigned char define uint unsigned intsbit CS1=P1^4。sbit CS2=P1^5。sbit RS=P0^5。sbit RW=P0^6。sbit EN=P0^7。sbit RST=P1^6。define DataPort P3void delay(unsigned long v) { while(v!=0)v。}void lcd_busy(void){RS=0。RW=1。DataPort=0xff。 while(1){EN=1。if(DataPort0x80) break。EN=0。}EN=0。}void wcode(uchar c,uchar csl,uchar csr){CS1=csl。CS2=csr。lcd_busy()。RS=0。RW=0。DataPort=c。EN=1。EN=0。}void wdata(uchar c,uchar csl,uchar csr) {CS1=csl。CS2=csr。lcd_busy()。RS=1。RW=0。DataPort=c。EN=1。EN=0。}void set_xy(uchar x,uchar y){x=x+0x40。y=y+0xb8。wcode(x,1,1)。wcode(y,1,1)。}void lw(uchar x, uchar y, uchar dd){if(x=64){set_xy(x64,y)。wdata(dd,0,1)。}else{set_xy(x,y)。wdata(dd,1,0)。}}void set_startline(uchar i){i=0xc0+i。wcode(i,1,1)。}void dison_off(uchar o){o=o+0x3e。wcode(o,1,1)。}void reset(){RST=0。delay(20)。RST=1。delay(20)。}void lcd_init(void) {uchar x,y。reset()。set_startline(0)。dison_off(0)。for(y=0。y8。y++){for(x=0。x128。x++)lw(x,y,0)。}dison_off(1)。}void display(uchar xx, uchar yy, uchar n, uchar fb,uchar hz[])//16*16點陣{uchar i,dx。for(i=0。i16。i++){dx=hz[2*i+n*32]。if(fb)dx=255dx。lw(xx*8+i,yy,dx)。dx=hz[(2*i+1)+n*32]。if(fb)dx=255dx。lw(xx*8+i,yy+1,dx)。}}void shownum(uchar xx,uchar yy,uchar n,uchar fb,uchar num[]) //8*16點陣{uchar i,dx。for(i=0。i8。i++){dx=num[2*i+n*16]。if(fb)dx=255dx。lw(xx*8+i,yy,dx)。dx=num[(2*i+1)+n*16]。if(fb)dx=255dx。lw(xx*8+i,yy+1,dx)。}}void jiemian() //界面,顯示固定字符{shownum(1,0,2,0,num)。//2shownum(2,0,0,0,num)。//0display(5,0,15,0,ch1616)。//年display(10,0,15,0,ch1616)。//閏年display(14,0,22,0,ch1616)。//℃display(2,2,16,0,ch1616)。//陽歷,月display(6,2,17,0,ch1616)。//陽歷,日display(10,4,16,0,ch1616)。//月,農(nóng)歷shownum(13,6,10,0,num)。//: 定時報警display(1,4,18,0,ch1616)。//星display(3,4,19,0,ch1616)。//期shownum(2,6,10,0,num)。//: 時分shownum(5,6,10,0,num)。//: 分秒}void diswendu() //溫度顯示{ReadTemp()。shownum(12,0,temp_value/10,0,num)。shownum(13,0,temp_value%10,0,num)
點擊復制文檔內(nèi)容
醫(yī)療健康相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1