完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
#include #include typedef unsigned int uint; typedef unsigned char uchar; uchar temp; uchar key=16; ***it rs=P2^0; ***it rw=P2^1; ***it lcden=P2^2; uchar idata table[18]="ATD+86"; uchar idata table[18]; uchar idata table_int[18]="ATD+86"; uchar idata receive[7]; uchar idata erro[7]="erronum"; uchar num=6,a=0,b=0; #define delayNOP();{_nop_();_nop_();_nop_();_nop_();}; void delay(uchar x) { uchar i; while(x--) { for(i=0;i<125;i++) { {;} } } } bit busy() { bit result; rs=0; rw=1; lcden=1; delayNOP(); result=(bit)(P0 & Ox80); lcden=0; return result; } void lcd_com(uchar cmd) { while(busy()); rs=0; rw=0; lcden=0; _nop_(); P0=cmd; delayNOP(); lcden=1; delayNOP(); lcden=0; } void lcd_pos(uchar pos) { lcd_com(pos|0x80); } void lcd_dat(uchar dat) { while(busy()); rs=1; rw=0; lcden=0; P0=dat; delayNOP(); lcden=1; delayNOP(); lcden=0; } void lcd_init() { delay(15); lcd_com(0x38); delay(5); lcd_com(ox38); delay(5); lcd_com(ox38); delay(5); lcd_com(0x0c); delay(5); lcd_com(0x38); delay(5); lcd_com(0x38); delay(5); } /* LCD ?? */ void display() { uchar a=0; lcd_pos(0); delay(30); while(table[a]!=' |