#include #include #define uchar unsigned char #define uint unsigned int sbit LCD_RS = P3^0; sbit LCD_RW = P3^1; sbit LCD_EN = P3^2; uchar code dis1[] = {" CHINESE "}; uchar code dis2[] = {" NEW YEAR "}; /*******************************************************************/ /* */ /* 延时子程序 */ /* */ /*******************************************************************/ void delay(int ms) { int i; while(ms--) { for(i = 0; i< 250; i++) { _nop_(); _nop_(); _nop_(); _nop_(); } } } /*******************************************************************/ /* */ /*检查LCD忙状态 */ /*lcd_busy 为1 时,忙,等待
lcd-busy 为0 时, 闲 ,可 写 指 令 与 数 据
*/ /* */ /*******************************************************************/ bit lcd_busy() { bit result; LCD_RS = 0; LCD_RW = 1; LCD_EN = 1; _nop_(); _nop_(); _nop_(); _nop_(