các anh cho em xin code hướng dẫn về các xuất ra LCD : "merry christmas" à có nếu có dấu thì các anh bày cho em làm với, cám ơn các anh chị rất nhiều
,
,
,
#include<AT89S53.h>
sbit RS = 0x94; // RS = P1_4
sbit RW = 0x95; // RW = P1_5
sbit E = 0x96; // E = P1_6
void delay_ms( unsigned int ms )
{ unsigned int i,j;
for (i=0;i<ms;i++)
for (j=0;j<120;j++){};
}
void LCD_PutChar(unsigned char k )
{ P2=k ; RS=1 ; RW=0 ; E=1 ; E=0 ; delay_ms(1);}
void LCD_PutCmd(unsigned char k )
{ P2=k ; RS=0 ; RW=0 ; E=1 ; E=0 ; delay_ms(3);}
void int_LCD()
{
LCD_PutCmd(0x38) ;
LCD_PutCmd(0x0C) ;
LCD_PutCmd(0x06) ;
LCD_PutCmd(0x01) ;
}
main()
{delay_ms(100);
int_LCD();
LCD_PutCmd(0x80) ; // gui lenh xuat chu o dong 1 cot 1 of LCD
LCD_PutChar('M');// hien chu M
while(1);
}
Comment