void main()
{
u8 i;
P4M0=0x1f;
P4M1=0x00; //将P40,P41,P42,P43,P44设为推挽
delay_ms(200);
OLED_Init(); //初始化OLED
OLED_ShowLine();
delay_ms(1000);
DS1302_Initial(); //初始化DS1302
DS1302_SetTime(init); //设置初始时间
xianshi();
DS1302_GetTime(now); //读取当前时间
while (1)
{
OLED_ShowChineseFont(0,0,0);//
OLED_ShowChineseFont(16,0,1);//
OLED_ShowChineseFont(32,0,2);//
OLED_ShowChineseFont(48,0,3);//
OLED_ShowChineseFont(64,0,4);//
OLED_ShowChineseFont(80,0,5);//
xianshi();
DS1302_GetTime(now);
BCD_to_DEC( );
}
}
|