《LCD1602简单显示程序(单片机)》由会员分享,可在线阅读,更多相关《LCD1602简单显示程序(单片机)(4页珍藏版)》请在金锄头文库上搜索。
#include #define uchar unsigned char #define uint unsigned int sbit LCD_E=P35; /定义接口 sbit LCD_RW=P36; sbit LCD_RS=P37; #define LCD_Data P1 /数据接口uchar up=“IvU,hupeixian“;uchar code down=“_by fu “/*延时函数*/void Delay_ms(uint time)uint i,j;for(i = 0;i 0x20) /若到达字串尾则退出 if (X = 0xF) /X 坐标应小于 0xF DisplayOneChar(X, Y, DDataListLength); /显示单个字符 ListLength+; X+; /*/void main(void) Delay_ms(400); /启动等待,等 LCD 讲入工作状态 LCD_Init(); /LCD 初始化 Delay_ms(5); /延时片刻(可不要)DisplayListChar(0, 1, up); DisplayListChar(6, 0, down); LCD_Data=0xff; while(1);