1602液晶测试程序(郭天祥版本).docVIP

  • 0
  • 0
  • 约1.17千字
  • 约 5页
  • 2023-08-07 发布于浙江
  • 举报
/*液晶接口:1,gnd 2,vcc 3液晶显示偏压信号,可串联1k电阻后接gnd 4 RS,数据命令选择端 5 RW读写选择端 6 E使能端 7~14 数据端口15,16液晶背光显示,需串联电阻15+ 16 -(500欧左右)*/ #includereg52.h #define uchar unsigned char #define uint unsigned int sbit lcden=P2^2; //使能端 sbit lcdrs=P2^0; //数据命令选择端 sbit rw=P2^1; uchar code table[]=xian shi 1; //输入的字符 uchar code table1[]=xian shi 2; //输入的字符 uchar num=0; void delay(uint z) { uint x,y; for(x=z;x0;x--) for(y=110;y0;y--); } void write_com(uchar com)//根据写时序图写出指令程序 { lcdrs=0; rw=0; P3=com; delay(5); lcden=1; delay(5); lcden=0; } void write_data(uchar date)//根据写时序图写出数据程序 { lcdrs=1; rw

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档