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

正文內(nèi)容

電子鐘設(shè)計報告(編輯修改稿)

2025-08-30 06:03 本頁面
 

【文章內(nèi)容簡介】 = P2^5。sbit DS_RST = P2^7。//設(shè)置時間,time[0]time[6]數(shù)據(jù)存放順序為:秒,分,時,日,月,星期,年unsigned char Times[7]={00,58,15,15,5,1,11}。/***************************************************************函數(shù)名: void Write_DS1302(uchar Command,uchar Value)參數(shù): Command=0寫命令,Command=1寫數(shù)據(jù) ,Value要寫入的值功能: 向DS1302中寫命令或數(shù)據(jù)返回: 無***************************************************************/void Write_DS1302(uchar Command,uchar Value){ uchar i = 0。 DS_RST = 0。 DS_CLK = 0。 DS_RST = 1。 for(i = 0。 i 8。 i++) { DS_IO = Command amp。 0x01。 DS_CLK = 0。 DS_CLK = 1。 Command = 1。 } for(i = 0。 i 8。 i++) { DS_IO = Value amp。 0x01。 DS_CLK = 0。 DS_CLK = 1。 Value = 1。 } }/***************************************************************函數(shù)名: uchar Read_DS1302(uchar Command)功能: 讀DS1302 中的數(shù)據(jù)或狀態(tài)返回: 讀到的數(shù)據(jù)或狀態(tài)值***************************************************************/uchar Read_DS1302(uchar Command){ uchar i = 0。 uchar Value = 0。 DS_RST = 0。 DS_CLK = 0。 DS_RST = 1。 for(i = 0。 i 8。i ++) { DS_IO = Command amp。 0x01。 DS_CLK = 0。 DS_CLK = 1。 Command = 1。 } for(i = 0。 i 8。i ++) { DS_CLK = 1。 DS_CLK = 0。 if(DS_IO) { Value |= 0x01 i。 } } DS_RST = 0。 Value = (Value /16 * 10) + Value %16。 return Value。}/***************************************************************函數(shù)名:void Write_1302_time(uchar *time)參數(shù):time存儲要設(shè)定時間的值功能:向Ds1302中寫入設(shè)定時間值返回:無***************************************************************/void Write_1302_time(uchar *time){ uchar add=0x80。 //地址add初值(秒),偶數(shù)地址為只寫 uchar i。 uchar timeBCD[7]。 //用以存放time數(shù)據(jù)的BCD碼值 uchar l,h。 //單位變量,分別存放時間數(shù)據(jù)(8421BCD碼)的低4位和高4位 for(i=0。i7。i++) //將時間數(shù)據(jù)轉(zhuǎn)為BCD碼放入timeBCD中 { l=time[i]%10。 h=time[i]/10。 timeBCD[i]=h*16+l。 } Write_DS1302(0x8e,0x00)。 //打開寄存器寫入 for(i=0。i7。i++) { Write_DS1302(add,timeBCD[i])。 //將時間數(shù)據(jù)寫入1302對應(yīng)的寄存器 add+=2。 //地址移動,確保地址為偶數(shù) } Write_DS1302(0x8e,0x80)。 //關(guān)閉寫}/****************************************************************函數(shù)名:void Read_1302_time(uchar time[])參數(shù):time存儲要設(shè)定時間的值功能:讀取當(dāng)前時間,存儲到Time[]中返回:無 ****************************************************************/void Read_1302_time(uchar time[]){ uchar i。 uchar add=0x81。 //設(shè)置地址add初值(秒),奇數(shù)為只讀 uchar l,h。 //單位變量,分別存放時間數(shù)據(jù)(8421BCD碼)的低4位和高4位,用以進行十進制轉(zhuǎn)換 for(i=0。i7。i++) { time[i]=Read_DS1302(add)。 //將時間數(shù)據(jù)(8421BCD碼)從1302對應(yīng)的寄存器中讀出 l=time[i]amp。0x0f。 //l存放time的低4位,即個位 h=(time[i]4)amp。0x0f。 //h存放time的高4位,即十位 time[i]=h*10+l。 //時間數(shù)據(jù)以十進制形式放進time[i]中 add+=2。 //地址移動,確保地址為奇數(shù) }}/***************************************************************函數(shù)名:Init_DS1302(void)參數(shù):無功能:初始化Ds1302返回:無***************************************************************/void Init_DS1302(void){ Write_DS1302(0x8E,0x00)。 //打開寄存器寫入 Write_DS1302(0x84,0x00)。 //設(shè)置24小時制 Write_DS1302(0x90,0xA5)。 //啟動充電功能 Write_DS1302(0x8E,0x80)。 //關(guān)閉寄存器操作 Write_1302_time(Times)。 //寫時間同時啟動時鐘}endif ifndef LCD_Hdefine LCD_Hinclude //定義管腳define DATA P0sbit RST=P1^0。 //Lcm reset,低有效 sbit E =P1^1。 //讀寫使 能 sbit RW =P1^2。 //,H:read,L:writesbit RS =P1^3。 //,H:寫數(shù)據(jù),L:寫指令sbit CS1=P1^5。 //cs1=L,選擇左半屏 sbit CS2=P1^4。 //cs2=L,選擇右半屏 /*============================= Time ===========================================*/const uchar code Time[4][16]={/* 文字: T *//* @宋體12。 此字體下對應(yīng)的點陣為:寬x高=8x16 */0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,/* 文字: i *//* @宋體12。 此字體下對應(yīng)的點陣為:寬x高=8x16 */0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,/* 文字: m *//* @宋體12。 此字體下對應(yīng)的點陣為:寬x高=8x16 */0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,/* 文字: e *//* @宋體12。 此字體下對應(yīng)的點陣為:寬x高=8x16 */0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00}。/*=============================== Data =========================================*/const uchar code Date[4][16] = {/* 文字: D *//* @宋體12。 此字體下對應(yīng)的點陣為:寬x高=8x16 */0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,/* 文字: a *//* @宋體12。 此字體下對應(yīng)的點陣為:寬x高=8x16 */0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,/* 文字: t *//* @宋體12。 此字體下對應(yīng)的點陣為:寬x高=8x16 */0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,/* 文字: e *//* @宋體12。 此字體下對應(yīng)的點陣為:寬x高=8x16 */0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00}。/*===============================特殊字符 頭====================================*/const uchar code zifu[4][16] = {/* 文字: 冒號 *//* @宋體12。 此字體下對應(yīng)的點陣為:寬x高=8x16 */0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,/* 文字: 橫杠 *//* @宋體12。 此字體下對應(yīng)的點陣為:寬x高=8x16 */0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,/* 文字: 大于號 *//* @宋體12。 此字體下對應(yīng)的點陣為:寬x高=8x16 */0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,/* 文字: 等號 *//* @宋體12。 此字體下對應(yīng)的點陣為:寬x高=8x16 */0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04
點擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1