e bó tay với cách lấy xâu ký tự rồi
sbit DATA = P1^0;
sbit SCK = P1^1;
sbit LACH = P1^2;
sbit DATA1=P2^0;
sbit SCK1=P2^1;
sbit LACH1=P2^2;
//unsigned char temp1,font2;
unsigned int i,j,d,k,c;
unsigned char code ma1[120]={
0xFF,0xFF,0xC1,0xB7,0xB7,0xC1,0xFF,0xFF,
0xFF,0xFF,0x81,0xAD,0xAD,0xD3,0xFF,0xFF,
0xFF,0xFF,0xC3,0xBD,0xBD,0xDB,0xFF,0xFF,
0xFF,0xFF,0x81,0xBD,0xBD,0xC3,0xFF,0xFF,
0xFF,0xFF,0x81,0xAD,0xAD,0xAD,0xFF,0xFF,
0xFF,0xFF,0x81,0xAF,0xAF,0xAF,0xFF,0xFF,
0xFF,0xFF,0xC3,0xBD,0xB5,0xD3,0xFF,0xFF,
0xFF,0xFF,0x81,0xEF,0xEF,0x81,0xFF,0xFF,
0xFF,0xFF,0xBD,0x81,0xBD,0xFF,0xFF,0xFF,
0xFF,0xFF,0x81,0xE7,0xDB,0xBD,0xFF,0xFF,
0xFF,0xFF,0x81,0xFD,0xFD,0xFD,0xFF,0xFF,
0xFF,0x81,0xDF,0xEF,0xDF,0x81,0xFF,0xFF ,
0xFF,0xFF,0x81,0xDF,0xEF,0x81,0xFF,0xFF,
0xFF,0xFF,0x8D,0xED,0xED,0x83,0xFF,0xFF,
0xFF,0x83,0xFD,0xC3,0x0C,0xFD,0x83,0xFF };
//unsigned char x;
unsigned char string[]= "ABC";
//unsigned char idata ma1[15][8];
unsigned char ma[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe} ;
void tre(long time)
{ while(time--)
{;}}
void quet(unsigned char x)
{
unsigned int i,t;
for(i=0;i<8;i++)
{
t=x;
t=t&0x80;
if(t==0x80)
DATA=1;
else
DATA=0;
x*=2;
SCK=1;
SCK=0;
}
LACH=1;
LACH=0;
}
void quet1(unsigned char b)
{
unsigned int i,t;
for(i=0;i<8;i++)
{
t=b;
t=t&0x80;
if(t==0x80)
DATA1=1;
else
DATA1=0;
b<<=1;
SCK1=1;
SCK1=0;
}
LACH1=1;
LACH1=0;
}
void main(void)
{ unsigned char c,d,l,a;
while(1) {
l=(strlen(string));
for(d=0;d<l;d++)
{//c=string[d];
c=ma1[string[d]*8];
{
for(a=0;a<l*8;a++)
{
for(j=0;j<4;j++)
{
for(k=0;k<8;k++)
{ quet1(0xff);
quet1(0xff);
quet1(0xff);
quet1(0xff);
quet(0xff);
tre(1);
quet(ma1[a+k]);
quet(ma1[a+k+8]);
quet(ma1[a+k+16]);
quet(ma1[a+k+24]);
LACH=0;
LACH=1;
{quet1(ma[k]);
quet1(ma[k]);
quet1(ma[k]);
quet1(ma[k]);}
LACH1=1;
LACH1=0;
tre(1);
}} } }} } }
sbit DATA = P1^0;
sbit SCK = P1^1;
sbit LACH = P1^2;
sbit DATA1=P2^0;
sbit SCK1=P2^1;
sbit LACH1=P2^2;
//unsigned char temp1,font2;
unsigned int i,j,d,k,c;
unsigned char code ma1[120]={
0xFF,0xFF,0xC1,0xB7,0xB7,0xC1,0xFF,0xFF,
0xFF,0xFF,0x81,0xAD,0xAD,0xD3,0xFF,0xFF,
0xFF,0xFF,0xC3,0xBD,0xBD,0xDB,0xFF,0xFF,
0xFF,0xFF,0x81,0xBD,0xBD,0xC3,0xFF,0xFF,
0xFF,0xFF,0x81,0xAD,0xAD,0xAD,0xFF,0xFF,
0xFF,0xFF,0x81,0xAF,0xAF,0xAF,0xFF,0xFF,
0xFF,0xFF,0xC3,0xBD,0xB5,0xD3,0xFF,0xFF,
0xFF,0xFF,0x81,0xEF,0xEF,0x81,0xFF,0xFF,
0xFF,0xFF,0xBD,0x81,0xBD,0xFF,0xFF,0xFF,
0xFF,0xFF,0x81,0xE7,0xDB,0xBD,0xFF,0xFF,
0xFF,0xFF,0x81,0xFD,0xFD,0xFD,0xFF,0xFF,
0xFF,0x81,0xDF,0xEF,0xDF,0x81,0xFF,0xFF ,
0xFF,0xFF,0x81,0xDF,0xEF,0x81,0xFF,0xFF,
0xFF,0xFF,0x8D,0xED,0xED,0x83,0xFF,0xFF,
0xFF,0x83,0xFD,0xC3,0x0C,0xFD,0x83,0xFF };
//unsigned char x;
unsigned char string[]= "ABC";
//unsigned char idata ma1[15][8];
unsigned char ma[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe} ;
void tre(long time)
{ while(time--)
{;}}
void quet(unsigned char x)
{
unsigned int i,t;
for(i=0;i<8;i++)
{
t=x;
t=t&0x80;
if(t==0x80)
DATA=1;
else
DATA=0;
x*=2;
SCK=1;
SCK=0;
}
LACH=1;
LACH=0;
}
void quet1(unsigned char b)
{
unsigned int i,t;
for(i=0;i<8;i++)
{
t=b;
t=t&0x80;
if(t==0x80)
DATA1=1;
else
DATA1=0;
b<<=1;
SCK1=1;
SCK1=0;
}
LACH1=1;
LACH1=0;
}
void main(void)
{ unsigned char c,d,l,a;
while(1) {
l=(strlen(string));
for(d=0;d<l;d++)
{//c=string[d];
c=ma1[string[d]*8];
{
for(a=0;a<l*8;a++)
{
for(j=0;j<4;j++)
{
for(k=0;k<8;k++)
{ quet1(0xff);
quet1(0xff);
quet1(0xff);
quet1(0xff);
quet(0xff);
tre(1);
quet(ma1[a+k]);
quet(ma1[a+k+8]);
quet(ma1[a+k+16]);
quet(ma1[a+k+24]);
LACH=0;
LACH=1;
{quet1(ma[k]);
quet1(ma[k]);
quet1(ma[k]);
quet1(ma[k]);}
LACH1=1;
LACH1=0;
tre(1);
}} } }} } }