新闻中心

EEPW首页 > 嵌入式系统 > 设计应用 > 1602液晶万能驱动程序

1602液晶万能驱动程序

作者:时间:2016-11-29来源:网络收藏
/*****************************************向lcd里写命令*****************************************/void lcd_writecom(uchar dat){check_busy();e(0);rs(0);rw(0);e(1);PORT=dat;e(0);}/***************************************读取lcd对应地址数据*****************************************/uchar lcd_readdat(void){uchar temp;check_busy();e(0);PORT_IN;rs(1);rw(1);e(1);temp=PORT_INT;e(0);PORT_OUT;return temp;}/****************************************向lcd里写数据****************************************/void lcd_writedat(uchar dat){check_busy();e(0);rs(1);rw(0);e(1);PORT=dat;e(0);}/****************************************向lcd写字符串*****************************************/void lcd_gets(const uchar *dat){while(*dat!=0){lcd_writedat(*dat);dat++;}}/*****************************************确定要写的位子即x y 坐标******************************************/void lcd_xy(uchar x,uchar y){switch(y){case 0:lcd_writecom(0x80+x);break;case 1:lcd_writecom(0xc0+x);break;}}/****************************************************单行显示才有5*10 其他5*8 MODe(1) 5*8 MODe(0) 5*10****************************************************/void add_custom_word(uchar *dat,uchar len,uchar mode){uchar n,m;for(n=0;n
上一页 1 2 下一页

关键词: 1602液晶万能驱

评论


技术专区

关闭