《lcd12864卷动显示程序.docx》由会员分享,可在线阅读,更多相关《lcd12864卷动显示程序.docx(2页珍藏版)》请在第一文库网上搜索。
1、Icd12864卷动显示程序2008-09-2316:49ftinc1udedefineuintunsignedint#defineucharunsignedcharucharnum,aa;ucharcodetab1e1二天宇风尘”;ucharcodetab1e1口二无量寿佛;sbit1cdrs=P24;sbit1cdrw=P2*5;sbit1cde=P2*6;sbitIcdpsb=P13;sbitICdrSt=P4;voidde1ayus(uinta)whi1e(a-);voidde1ayms(uintb)uintc,d;for(c=b;c0;c一)for(d=110;d0;d);)void
2、write_com(ucharcom)Icdrs=O;Icdrw=O;de1ayus(10);Icde=I;P0=com;de1ayms(2);1cde=0;voidwrite_date(uchardate)(Icdrs=I;1cdrw=0;de1ayus(10);Icde=I;P0=date;de1ayms(2);1cde=0;voidinit12864()de1ayms(5);Icdpsb=I;Icdrst=I;Icde=O;write_com(0x01);de1ayus(2);write_com(OxOc);de1ayus(2);write_com(0x30);基本指令de1ayus(100);write_com(0x80);for(num-0;num8;num+)write_date(tab1enum);write_com(0x88);for(num=0;num8;num+)write_date(tab1e1num);write_com(0x34);扩充指令de1ayus(100);write_com(0x03);允许输入垂直地址de1ayus(100);)voidmainOinit_12864();whi1e(1)for(aa-0x60;aa0x80;aa+)(write_com(aa);de1ayms(200);