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

正文內(nèi)容

基于51單片機(jī)的多功能時(shí)鐘(編輯修改稿)

2024-07-21 02:15 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 SID = CY 。 //移出的位給SID SCK = 1 。 SCK = 0 。 }}//串口接收一個(gè)字節(jié)//僅在讀取數(shù)據(jù)的時(shí)候用到//而讀出的數(shù)據(jù)是一次只能讀出4bit的unsigned char ReceiveByte(void){ unsigned char n,x,y 。 x=y=0 。 for(n=0 。n8 。n++) { x=x1 。 SCK = 0 。 SCK = 1 。 SCK = 0 。 if(SID) x++ 。 } for(n=0 。n8 。n++) { y=y1 。 SCK = 0 。 SCK = 1 。 SCK = 0 。 if(SID) y++ 。 } return ((0xf0amp。x)+(0x0famp。y)) 。}void CheckBusy( void ){ do SendByte(0xfc) 。 //11111,RW(1),RS(0),0 while(0x80amp。ReceiveByte()) 。 //BF(.7)=1 Busy}void WriteCommand( unsigned char Cbyte ){ CS = 1 。 CheckBusy() 。 SendByte(0xf8) 。 //11111,RW(0),RS(0),0 SendByte(0xf0amp。Cbyte) 。 //高四位 SendByte(0xf0amp。Cbyte4) 。//低四位(先執(zhí)行 。) CS = 0 。}void WriteData( unsigned char Dbyte ){ CS = 1 。 CheckBusy() 。 SendByte(0xfa) 。 //11111,RW(0),RS(1),0 SendByte(0xf0amp。Dbyte) 。 //高四位 SendByte(0xf0amp。Dbyte4) 。//低四位(先執(zhí)行 。) CS = 0 。}/*unsigned char ReadData( void ){ CheckBusy() 。 SendByte(0xfe) 。 //11111,RW(1),RS(1),0 return ReceiveByte() 。}*/void Delay(unsigned int MS){ unsigned char us,usn 。 while(MS!=0) //for 12M { usn = 2 。 while(usn!=0) { us=0xf5 。 while (us!=0){us 。} 。 usn 。 } MS 。 }}void LcmInit( void ){ WriteCommand(0x30) 。 //8BitMCU,基本指令集合 WriteCommand(0x03) 。 //AC歸0,不改變DDRAM內(nèi)容 WriteCommand(0x0C) 。 //顯示ON,游標(biāo)OFF,游標(biāo)位反白OFF WriteCommand(0x01) 。 //清屏,AC歸0 WriteCommand(0x06) 。 //寫(xiě)入時(shí),游標(biāo)右移動(dòng)}void lcd_clear_one(void){unsigned char i。for(i=0。i16。i++)WriteData(39。 39。)。}//文本區(qū)清RAM函數(shù)void LcmClearTXT( void ){ unsigned char i 。 WriteCommand(0x30) 。 //8BitMCU,功能設(shè)定,基本指令集合 WriteCommand(0x80) 。 //AC歸起始位 for(i=0 。i64 。i++) WriteData(0x20) 。}void setadd(unsigned char row,unsigned char col){ WriteCommand(AC_TABLE[8*row+col]) 。}void writeword(unsigned char row,unsigned char col,unsigned char * puts){ WriteCommand(0x30) 。 //8BitMCU,基本指令集合 WriteCommand(AC_TABLE[8*row+col]) 。 //起始位置 while((*puts) != 39。\039。) //判斷字符串是否顯示完畢 { WriteData(*puts) 。 puts++ 。 }}void LCD_prints(unsigned char *puts){WriteCommand(0x30) 。 while((*puts) != 39。\039。) //判斷字符串是否顯示完畢 { WriteData(*puts) 。 puts++ 。 }}void PutStr(unsigned char row,unsigned char col,unsigned char *puts){ WriteCommand(0x30) 。 //8BitMCU,基本指令集合 WriteCommand(AC_TABLE[8*row+col]) 。 //起始位置 while(*puts != 39。\039。) //判斷字符串是否顯示完畢 { if(col==8) //判斷換行 { //若不判斷,則自動(dòng)從第一行到第三行 col=0 。 row++ 。 } if(row==4) row=0 。 //一屏顯示完,回到屏左上角 WriteCommand(AC_TABLE[8*row+col]) 。 WriteData(*puts) 。 //一個(gè)漢字要寫(xiě)兩次 puts++ 。 WriteData(*puts) 。 puts++ 。 col++ 。 }}/******************** LCD PART STOP *******************************//***************************************18B20********************************************/sbit DQ =P1^6。 //定義通信端口//延時(shí)函數(shù)void delay_1820(unsigned char i){ while(i)。}//初始化函數(shù)Init_DS18B20(void){ unsigned char x=0。 DQ = 1。 //DQ復(fù)位 delay_1820(8)。 //稍做延時(shí) DQ = 0。 //單片機(jī)將DQ拉低 delay_1820(80)。 //精確延時(shí) 大于 480us DQ = 1。 //拉高總線 delay_1820(14)。 x=DQ。 //稍做延時(shí)后 如果x=0則初始化成功 x=1則初始化失敗 delay_1820(20)。}//讀一個(gè)字節(jié)ReadOneChar(void){unsigned char i=0。unsigned char dat = 0。for (i=8。i0。i) { DQ = 0。 // 給脈沖信號(hào) dat=1。 DQ = 1。 // 給脈沖信號(hào) if(DQ) dat|=0x80。 delay_1820(4)。 } return(dat)。}//寫(xiě)一個(gè)字節(jié)WriteOneChar(unsigned char dat){ unsigned char i=0。 for (i=8。 i0。 i) { DQ = 0。 DQ = datamp。0x01。 delay_1820(5)。 DQ = 1。 dat=1。 }//delay(4)。}//讀取溫度ReadTemperature(void){unsigned char a=0。unsigned char b=0。unsigned int t=0。unsigned char tt=0。Init_DS18B20()。WriteOneChar(0xCC)。 // 跳過(guò)讀序號(hào)列號(hào)的操作WriteOneChar(0x44)。 // 啟動(dòng)溫度轉(zhuǎn)換Init_DS18B20()。WriteOneChar(0xCC)。 //跳過(guò)讀序號(hào)列號(hào)的操作WriteOneChar(0xBE)。 //讀取溫度寄存器等(共可讀9個(gè)寄存器) 前兩個(gè)就是溫度a=ReadOneChar()。b=ReadOneChar()。t=b。t=8。t=t|a。tt=t*。 //放大10倍輸出并四舍五入return(tt)。}/******************** Display PART ******************************/void chose(void){ switch (read_rtc_code[3]1) { case 0:writeword(2,0,星期一)。break。 case 1:writeword(2,0,星期二)。break。 case 2:writeword(2,0,星期三)。break。 case 3:writeword(2,0,星期四)。break。 case 4:writeword(2,0,星期五)。break。 case 5:writeword(2,0,星期六)。break。 case 6:writeword(2,0,星期日)。break。 }}void Display(void) { setadd(0,1)。//second WriteData((read_rtc_code[6]/10)|0x30)。 WriteData((read_rtc_code[6]%10)|0x30)。 WriteData(39。39。)。 WriteData((read_rtc_code[5]/10)|0x30)。 WriteData((read_rtc_code[5]%10)|0x30)。 WriteData(39。39。)。 WriteData((read_rtc_code[4]/10)|0x30)。 WriteData((read_rtc_code[4]%10)|0x30)。 setadd(1,0)。 WriteData((read_rtc_code[2]/10)|0x30)。 WriteData((read_rtc_code[2]%10)|0x30)。 WriteData(39。:39。)。 WriteData((read_rtc_code[1]/10)|0x30)。 WriteData((read_rtc_code[1]%10)|0x30)。 WriteData(39。:39。)。 WriteData((read_rtc_code[0]/10)|0x30)。 WriteData((read_rtc_code[0]%10)|0x30)。 chose()。 writeword(0,0,20)。 i=Re
點(diǎn)擊復(fù)制文檔內(nèi)容
法律信息相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1