#include<reg51.h>
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
sbit SERIN=P2^3;
sbit SRCK=P2^1;
sbit RCK1=P2^0;
sbit G1OUT=P2^7; //+
sbit G2OUT=P2^2; //-
sbit AOUT=P2^4;
sbit BOUT=P2^5;
sbit COUT=P2^6;
uchar code table[4][128]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x06,0x40,0x38,0x50,0x08,0x48,0x08,0x48,0x08,0x40,0xFF,0xFE,0x08,0x40,0x08,0x48,0x0E,0x28,0x38,0x30,0xC8,0x20,0x08,0x50,0x09,0x92,0x08,0x0A,0x28,0x06,0x10,0x02,//我
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x22,0x20,0x22,0x20,0xFF,0xA0,0x22,0x20,0x3E,0xFC,0x08,0x24,0x7F,0x24,0x49,0x24,0x49,0x24,0x7F,0x24,0x08,0x24,0xFF,0x44,0x08,0x44,0x08,0x94,0x09,0x08,0x08,0x00,//勒
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x00,0x01,0x00,0x02,0x80,0x02,0x40,0x04,0x20,0x09,0x18,0x11,0x0E,0x61,0x04,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x00,0x00,//個
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x00,0x01,0x00,0x01,0x00,0x3F,0xFC,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x7F,0xFE,0x02,0x00,0x06,0x00,0x08,0x20,0x10,0x10,0x3F,0xF8,0x10,0x10,0x00,0x00,//去
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
},
};
void delay1(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=10;y>0;y--);
}
void send(uchar byte)
{
uchar i=8;
while(i--)
{
SRCK =0;
SERIN=(byte&0x80);
byte<<=1;
SRCK =1;
}
}
void sendb(uchar bite)
{
while(bite--)
{
SRCK =0;
SERIN=0;
SRCK =1;
}
}
void OutPut(uchar k)
{
RCK1=0;
RCK1=1;
RCK1=0;
delay1(k);
}
void lost()
{
uchar i=64;
OutPut(10);
while(i--)
{
SRCK =0;
SERIN=0;
SRCK =1;
}
OutPut(0);
}
void main(void)
{
uint a, b,c,d,e;
EA=1;
ET0=1;
TMOD=0x02;
TH0=56;
TR0=1;
G2OUT=0;
while(1)
{
for(a=0;a<32;a++)
{
if(a%16==0)e=40;
else e=4;
while(e--)
{
for(b=0;b<16;b++)
{
for(c=0;c<4;c++)
{
for(d=0;d<2;d++)
{
send(table[c][2*b+d+a*2]);
}
}
if(a>16)sendb(a);
G1OUT=b/8;
AOUT=0x01&b;
BOUT=0x02&b;
COUT=0x04&b;
lost();
}
}
}
}
}
|