|
各位好:
/*寫命令比如光標(biāo)顯示與不顯示,需不需要移屏,在液晶什么位置顯示 */
void xieml (unsigned char ml)
{
eo=0;
dx=0; // R/W讀寫選擇。H/L..
sm=0; //RS 數(shù)據(jù)/命令選擇。H/L.
P0=ml;
Lcd1602_Delay1ms(5);
eo=1;
Lcd1602_Delay1ms(5);
eo=0;
}
/*寫數(shù)據(jù)比如在液晶顯示什么容 */
void xiesj(unsigned char sj)
{
eo=0;
dx=0; // R/W讀寫選擇。H/L.
sm=1; //RS 數(shù)據(jù)/命令選擇。H/L.
P0=sj;
Lcd1602_Delay1ms(5);
eo=1;
Lcd1602_Delay1ms(5);
eo=0;
}
void chushiha()
{
xieml(0X38);
xieml(0X0c);
// xieml(0X06);
xieml(0X01);
}
void main()
{
InitTimer0();
chushiha();
xieml(0X80);
xiesj(0);
Lcd1602_Delay1ms(5);
xieml(0X80+0X03);
xiesj(0X04);
Lcd1602_Delay1ms(5);
while(1);
}
1206顯示的位置對(duì)了,但是亂碼,,C基礎(chǔ)太差了,不知道是哪 里沒有定義好, 一行0位置顯示0,
一行3位置顯示4.
請(qǐng)教 謝 |
|