lcd静态显示电路图及c语言程序.docVIP

  • 6
  • 0
  • 约1.84千字
  • 约 3页
  • 2017-03-23 发布于重庆
  • 举报
lcd静态显示电路图及c语言程序

Lcd静态显示电路图及c语言程序 #includeat89x51.h #define uint unsigned int #define uchar unsigned char sbit RS=P2^0; sbit RW=P2^1; sbit EN=P2^2; uchar i,j; uchar code table1[]={ 0x00,0x00,0x00,0x00,0x00,0x1f,0x00,0x00, 0x00,0x00,0x00,0x0e,0x00,0x1f,0x00,0x00, 0x00,0x0e,0x00,0x0e,0x00,0x1f,0x00,0x00, 0x08,0x1f,0x12,0x0f,0x0a,0x1f,0x02,0x00, 0x0f,0x09,0x0f,0x09,0x0f,0x09,0x13,0x00, 0x1f,0x11,0x11,0x1f,0x11,0x11,0x1f,0x00, 0x1f,0x04,0x04,0x04,0x04,0x04,0x1f,0x00, 0x04,0x04,0x1f,0x15,0x1f,0x04,0x04,0x00, }; uchar code table2[]= QQ:1093027367; uchar code tab[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07}; void delayms(uint z) { uint x,y; for(x=z;x0;x--) for(y=110;y0;y--); } void write_com(uchar date,uchar b) { RS=b; P0=date; delayms(5); EN=1; delayms(5); EN=0; } void init(void) { RW=0; EN=0; write_com(0x38,0); write_com(0x0c,0); write_com(0x06,0); write_com(0x01,0); } void main() { init(); write_com(0x40,0); for(i=0;i64;i++) { write_com(table1[i],1); delayms(5); } write_com(0x80,0); write_com(tab[0],1); delayms(100); write_com( ,1); delayms(100); write_com(tab[1],1); delayms(100); write_com( ,1); delayms(100); write_com(tab[2],1); delayms(100); write_com( ,1); delayms(100); write_com(tab[3],1); delayms(100); write_com( ,1); delayms(100); write_com(tab[4],1); delayms(100); write_com( ,1); delayms(100); write_com(tab[5],1); delayms(100); write_com( ,1); delayms(100); write_com(tab[6],1); delayms(100); write_com( ,1); delayms(100); write_com(tab[7],1); delayms(100); write_com(0x80+40,0); delayms(100); for(j=0;j143;j++) { write_com(table2[j],1); delayms(5); } while(1); }

文档评论(0)

1亿VIP精品文档

相关文档