1602显示汉字.docx
《1602显示汉字.docx》由会员分享,可在线阅读,更多相关《1602显示汉字.docx(8页珍藏版)》请在第壹文秘上搜索。
1、1602显示汉字程序代码:1602.c:includeLCD1602/LCD1602.Hexternunsignedcharpattern;voidDelay_us(unsignedchart)(while(-t);)voidDelay_ms(unsignedchart)(whiIe(t一)(De1ayus(225);Delay_us(227);)voidInit_1602(void)(Delay_ms(15);Write_Char1602(0x38,CMD,0);/don,tcheckbusyDeIayJnS(5);Write_Char_1602(0x38,CMD,0);Delay_ms(5
2、);Write_Chaj1602(0x38,CMD,0);Write_Char_1602(0x38,CMD,1);/8wire,2linedisplay,5x10charWrite_Char_1602(0x08,CMD,1);/closedisplay,nocursor,don,tblinkWrite_Char_1602(0x01,CMD,1)clearscreenWrite_Char_1602(0x06,CMD,1);/thecursormovefromlefttoright,thetextdon,tmoveWrite_Char_1602(0x0c,CMD,1)jopendisplay)vo
3、idWrite_Char_1602(unsignedcharData,bitCMDDATA,bitCheck)(if(Check)Check_Busy_1602();RS602=CMD_DATA;RW_1602=WRITE;DATA_1602=Data;E_1602=l;_nop_();E_1602=0;)unsignedcharRead_Char_1602(unsignedcharAddr,bitCheck)(unsignedchartemp;Write_Char_1602(Addr,CMD,1);if(Check)Check_Busy_1602();DATA_1602=0xff;RS602
4、=DATA;RWI602=READ;E_1602=l;_nop_O;temp=DTA-1602;E_1602=O;returntemp;)voidWrite_String1602(unsignedchar*P)/onlycanwritefromstarttoend(unsignedchari,Ien;Ien=Strlen(P);Set_R_C(0,0);if(len16)(for(i=0;i16;i+)(Write_Char_1602(Pi,DATA,1);)Set_R_C(l,O);for(i=16;ilen;i+)(Write_Char_1602(Pi,DATA,1);elsefor(i=
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 1602 显示 汉字
