#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
#define LCM_Data P0 //LCD1602êy¾Y½ó¿ú
#define Busy 0x80 //óÃóú¼ì2aLCM×′ì¬×ÖÖDμÄBusy±êê¶
sbit LCM_RW = P1^1; //¶áD′¿ØÖÆêäèë¶Ë£¬LCD1602μÄμúÎå½Å
sbit LCM_RS = P1^0; //¼Ä′æÆ÷Ñ¡Ôñêäèë¶Ë£¬LCD1602μÄμúËĽÅ
sbit LCM_E = P2^5; //ê1ÄüDÅoÅêäèë¶Ë,LCD1602μÄ ú6½Å
//=================ÑÕé«′«¸DÄ£¿éᬽó=====================
/*-----------------------------------------------------
|EO-----GND
|S0-----VCC | S2-----P1.0 | OUT-------P3.5
|S1-----VCC | S3-----P1.1 |
---------------------------------------------------*/
sbit tcs230_s2=P3^3;//TCS230 S2½óμ¥Ƭ»úP1.0
sbit tcs230_s3=P3^4;//TCS230 S3½óμ¥Ƭ»úP1.1
sbit tcs230_en=P3^0; //TCS230 EN(E0)½óGND
//**************oˉêyéùÃ÷***************************************
void WriteDataLCM |