void SER() interrupt 4
{
RI = 0;
serBuff = SBUF;
if(serBuff == 0x01)
{
SerFlag = 1;
}
if(serBuff == 0x02)
{
SerFlag = 2;
}
if(serBuff == 0x03)
{
SerFlag = 3;
}
}
delay.c文件
#include "delay.h"
void delay_50us(uint t)
{
uchar j;
for(;t>0;t--);
for(j=19;j>0;j--);
}
void delay_50ms(uint t)
{
uint j;
for(;t>0;t--);
for(j=6245;j>0;j--);
}
void delays(uint j)
{
while(j--);
}
lcd.c文件
#include <reg52.h>
#include "delay.h"
#include "lcd12864.h"
uchar code pic2[]={
"欢迎乘坐本次列车"//
"请您在快到站时提"
"如果您需要下车,"//
"前按铃,谢谢! "//
};
uchar code pic4[] = {
"司机已经收到您的"
"会在列车到站时为"
"下车信息,我们将"
"您打开车门! "
};
uchar code pic5[] = {
"尊敬的乘客,您已"
"您的行里准备下车"
"经到站了,请带好"
"欢迎再次乘坐本车"
};
uchar code pic[] = {
"已经有乘客按铃了"
"请不要重复按铃 "
"请您耐心等候 "
"祝您乘车愉快 "
};
unsigned char code pic3[]=
{
0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,
0x00,0x07,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x00,0x03,0x00,0x07,0xEC,0xC0,0x00,0x00,
0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x37,0x80,0x03,0x00,
0x00,0xEC,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,
0x18,0x3F,0xC0,0x03,0x00,0x0F,0x6E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x06,0x00,0x18,0x79,0x80,0x03,0x00,0x0F,
0x6B,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x18,
0x7F,0x00,0x1F,0xF4,0x01,0xE9,0xE0,0x00,0x00,0x00,0x00,
0x00,0x00,0xC6,0xE0,0x18,0xFF,0x80,0x1F,0xFC,0x00,0xFB,
0x30,0x00,0x00,0x00,0x00,0x00,0x01,0xC6,0x70,0x1B,0x1E,
0xC0,0x03,0x38,0x01,0xB3,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0x86,0x38,0xDB,0xFF,0xE0,0x03,0x70,0x07,0x9E,0x7F,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x26,0x18,0xDB,0x8C,0x70,
0x7F,0xFF,0x87,0x27,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
0x3E,0x01,0xFF,0xFF,0xB8,0x7F,0xFF,0x80,0x3F,0xC0,0x00,
0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x00,0x0C,0x18,0x07,
0x80,0x00,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,
0x00,0x00,0xFF,0xE0,0x0F,0x00,0x00,0xFB,0x1F,0xF8,0x00,
0x00,0x00,0x00,0x00,0x00,0x7F,0xF0,0xFF,0xE0,0x1F,0x30,
0x01,0xCF,0xFF,0xFF,0x09,0x00,0x00,0x00,0x00,0x03,0xFF,
0xFF,0x0C,0x00,0x3B,0x36,0x03,0x07,0xFF,0xFF,0xE0,0x00,
0x00,0x00,0x00,0x0F,0xFF,0xFF,0xCC,0x00,0x73,0x76,0x03,
0x3F,0xFF,0xFF,0xF7,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,
0xFC,0x00,0x63,0xE6,0x00,0x3F,0xFF,0xFF,0xDC,0x80,0x00,
0x00,0x00,0x7F,0xFF,0xFF,0xFC,0x00,0x03,0xFE,0x00,0x7F,
0xFF,0xFF,0xAF,0x60,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFC,
0x00,0x03,0xFE,0x00,0xFF,0xFF,0xFF,0xF5,0xC0,0x00,0x00,
0x01,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x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,0x00,0x3F,0xC0,0x3F,0xE0,0x00,0x00,
0x00,0x00,0x7F,0x00,0x3F,0xF0,0x00,0x00,0x00,0x00,0x3F,
0xC0,0x7F,0xE0,0x00,0x00,0x00,0x00,0x7F,0x00,0x3F,0xE0,
0x00,0x00,0x00,0x00,0x1F,0xE0,0x7F,0xC0,0x00,0x00,0x00,
0x00,0x3F,0x00,0x3F,0xE0,0x00,0x00,0x00,0x00,0x1F,0xE0,
0x7F,0xC0,0x00,0x00,0x00,0x00,0x3F,0x00,0x7F,0xE0,0x01,
0xC0,0xE0,0x00,0x1F,0xE0,0xFF,0xC0,0x00,0x70,0xE0,0x00,
0x3F,0x00,0x7F,0xE0,0x03,0xF3,0xF0,0x00,0x1F,0xE0,0xFF,
0xC0,0x00,0xF9,0xF0,0x00,0x3F,0x00,0x7F,0xE0,0x07,0xFF,
0xF8,0x00,0x1F,0xE0,0xFF,0xC0,0x01,0xFF,0xF8,0x00,0x3F,
0x00,0x7F,0xE0,0x07,0xFF,0xF8,0x00,0x1F,0xE0,0xFF,0xC0,
0x01,0xFF,0xF8,0x00,0x3F,0x00,0x7C,0xE0,0x07,0xFF,0xF8,
0x00,0x1B,0xE0,0xF9,0xC0,0x01,0xFF,0xF8,0x00,0x37,0x00,
0x38,0xF0,0x03,0xFF,0xF0,0x00,0x39,0xE0,0xF1,0xE0,0x00,
0xFF,0xF0,0x00,0x73,0x00,0x30,0x70,0x01,0xFF,0xE0,0x00,
0x30,0xC0,0x60,0xE0,0x00,0x7F,0xE0,0x00,0x61,0x00,0x00,
0x78,0x00,0xFF,0xC0,0x00,0x30,0x00,0x00,0xF0,0x00,0x3F,
0xC0,0x00,0x60,0x00,0x00,0x38,0x00,0x7F,0x80,0x00,0x60,
0x00,0x00,0x70,0x00,0x1F,0x80,0x00,0xC0,0x00,0x00,0x1C,
0x00,0x3F,0x00,0x00,0xC0,0x00,0x00,0x38,0x00,0x0F,0x00,
0x01,0x80,0x00,0x00,0x0E,0x00,0x1E,0x00,0x00,0x80,0x00,
0x00,0x1C,0x00,0x06,0x00,0x01,0x00,0x00,0x00,0x07,0x00,
0x0C,0x00,0x01,0x80,0x00,0x00,0x0E,0x00,0x06,0x00,0x03,
0x00 };
void write_12864com(uchar com)
{
rw = 0;
rs = 0;
delay_50us(1);
P0 = com;
e = 1;
delay_50us(10);
e = 0;
delay_50us(2);
}
void write_12864dat(uchar dat)
{
rw = 0;
rs = 1;
delay_50us(1);
P0 = dat;
e = 1;
delay_50us(10);
e = 0;
delay_50us(2);
}