内容发布更新时间 : 2025/7/12 7:23:51星期一 下面是文章的全部内容请认真阅读。
______________________________________________________________________________________________________________
////////////////////////////////////////////////////////////// void delay_ms(unsigned int n) //延时10×n毫秒程序 {
unsigned int i,j; for(i=0;i
void delay(unsigned int m) 延时程序 {
unsigned int i,j; for(i=0;i
精品资料
//1US ______________________________________________________________________________________________________________
}
/////////////////////////////////////////////////////////////// //判LCM忙子函数
void check_LCD_busy (void) {
Dataport = 0xff; RS = 0; RW = 1; EN = 1;
while (Busyport); EN = 0; }
/////////////////////////////////////////////////////////////// //写命令子函数
精品资料
______________________________________________________________________________________________________________
void write_com(uchar Command) {
check_LCD_busy(); RW=0; RS=0; delay(1); P0=Command; EN=1; delay(1); EN=0; }
//////////////////////////////////////////////////////////////// //写数据子函数
精品资料
______________________________________________________________________________________________________________
void write_data(uchar Data) {
check_LCD_busy(); RW=0; RS=1; delay(1); P0=Data; EN=1; delay(1); EN=0; }
///////////////////////////////////////////////////////////////// //LCM清屏函数
精品资料
______________________________________________________________________________________________________________
void lcdClear (void) {
write_com(0x01); }
//////////////////////////////////////////////////////////////// //LCM复位函数 void reset () {
RES=0; //复位 delay(1); //延时 RES=1; //复位置高 delay(10); }
精品资料