單片機設計LCD數(shù)字鐘(萬年歷)
delay(2);
lcd_w_dat('-');
delay(2);
lcd_w_dat(lcdd[day/10]);
delay(2);
lcd_w_dat(lcdd[day%10]);
delay(2);
}
/*第二行顯示時間、星期函數(shù)*/
void dispt()
{
lcd_w_cmd(0x0c); //設置光標不顯示、不閃爍
delay(20);
lcd_w_cmd(0xc3); //第二行起始顯示地址0x80+0x43
delay(20);
lcd_w_dat(lcdd[hour/10]);
delay(2);
lcd_w_dat(lcdd[hour%10]);
delay(2);
lcd_w_dat(':');
delay(2);
lcd_w_dat(lcdd[min/10]);
delay(2);
lcd_w_dat(lcdd[min%10]);
delay(2);
lcd_w_dat(':');
delay(2);
lcd_w_dat(lcdd[sec/10]);
delay(2);
lcd_w_dat(lcdd[sec%10]);
delay(2);
lcd_w_dat(' ');
delay(2);
lcd_w_dat('W');
delay(2);
lcd_w_dat(lcdd[week]);
delay(2);
}本文引用地址:http://cafeforensic.com/article/172587.htm
評論