lcd1602与单片机

lcd1602与单片机

ID:22682776

大小:63.01 KB

页数:7页

时间:2018-10-30

lcd1602与单片机_第1页
lcd1602与单片机_第2页
lcd1602与单片机_第3页
lcd1602与单片机_第4页
lcd1602与单片机_第5页
资源描述:

《lcd1602与单片机》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、液晶1602的汉字显示运行环境:STC89C52单片机12M晶振程序说明:***************************************************************/#include#include#defineucharunsignedchar#defineuintunsignedintsbite=P2^7;sbitrs=P2^6;sbitrw=P2^5;sbitLCD7=P0^7;sbitLCD6=P0^6;sbitLCD5=P0^5;sbitLCD4=P0^4;ucharb

2、datalcdbuff;uintloop,x=30;sbitlcdbuff0=lcdbuff^0;sbitlcdbuff1=lcdbuff^1;sbitlcdbuff2=lcdbuff^2;sbitlcdbuff3=lcdbuff^3;sbitlcdbuff4=lcdbuff^4;sbitlcdbuff5=lcdbuff^5;sbitlcdbuff6=lcdbuff^6;sbitlcdbuff7=lcdbuff^7;/**************字模*****************/unsignedcharcodetab[]={/*--文字:中--*/

3、/*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/0x01,0x01,0x21,0x3F,0x21,0x21,0x21,0x21,0x21,0x3F,0x21,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x08,0xFC,0x08,0x08,0x08,0x08,0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,/*--文字:国--*//*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/0x00,0x7F,0x40,0x5F,0x41,0x41,0x41,0x4F,0x

4、41,0x41,0x41,0x5F,0x40,0x40,0x7F,0x40,0x00,0xFC,0x04,0xF4,0x04,0x04,0x04,0xE4,0x44,0x24,0x24,0xF4,0x04,0x04,0xFC,0x04,/*--文字:电--*//*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/0x01,0x01,0x01,0x3F,0x21,0x21,0x3F,0x21,0x21,0x21,0x3F,0x21,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0xF8,0x08,0x08,0xF8,0x

5、08,0x08,0x08,0xF8,0x08,0x02,0x02,0xFE,0x00,/*--文字:子--*//*--宋体12;此字体下对应的点阵为:宽x高=16x16--*/0x00,0x3F,0x00,0x00,0x00,0x01,0x01,0x01,0xFF,0x01,0x01,0x01,0x01,0x01,0x05,0x02,0x00,0xF0,0x20,0x40,0x80,0x00,0x00,0x04,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:网--*//*--宋体12;此字体下对应的点阵为:

6、宽x高=16x16--*/0x00,0x7F,0x40,0x41,0x51,0x4A,0x44,0x44,0x4A,0x4A,0x51,0x61,0x40,0x40,0x40,0x00,0x00,0xFC,0x04,0x04,0x14,0x9C,0x54,0x24,0x24,0x54,0x94,0x04,0x04,0x1C,0x08,0x00,};/************函数声明***************/voidr_BF();voidw_cdata(void);voidw_com(ucharcom);voidw_sting(ucharstring

7、);voidinit_lcd();voidcg_w();voidw_word(ucharword);voiddelay(uintxms);/************主函数*************/voidmain(){init_lcd();while(1){w_com(0x01);//清屏loop=0;cg_w();w_com(0x80);w_word(0x00);w_word(0x00+2);w_word(0x00+4);w_com(0x80+0x40);w_word(0x00+1);w_word(0x00+3);w_word(0x00+5);del

8、ay(x);//********************************

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。