#include<reg52.h>
#include<intrins.h>
typedef unsigned char u8;
typedef unsigned int u16;
sbit sck=P3^6; //输入数据时钟
sbit rck=P3^5; //输出锁存器时钟
sbit ser=P3^4; //写数据口
//点阵显示数组 相当于点阵的行扫描
u8 code word0[] = {0x00, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x80,
0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x80, 0x00};
// 永
u8 code word1[]={96,0,128,0,0,0,248,0,128,8,128,4,158,2,144,1,144,2,136,4,132,8,130,48,161,16,64,0,0,0,0,0};
// 远
u8 code word2[]={2,4,228,15,4,0,0,0,240,31,64,2,71,2,68,2,68,18,36,18,20,28,10,0,49,0,192,63,0,0,0,0};
// 的
u8 code word3[]={8,2,8,2,4,17,62,63,162,16,98,16,34,17,62,18,34,18,34,16,34,16,34,16,62,10,34,4,0,0,0,0};
// 黄
u8 code word4[]={32,2,32,10,254,31,32,2,255,63,128,0,248,15,136,8,248,15,136,8,248,15,32,2,24,4,6,24,0,0,0,0};
// 家
u8 code word5[]={64,0,128,0,254,31,2,16,248,7,32,8,88,4,166,2,144,3,76,5,32,9,16,49,46,17,192,0,0,0,0,0};
// 驹
u8 code word6[]={16,1,63,1,144,16,146,63,82,16,178,23,146,20,190,20,160,20,184,23,167,20,32,16,20,18,8,12,0,0,0,0};
// B
u8 code word7[]={0,0,0,0,0,0,0,0,255,0,230,0,198,0,230,0,126,0,230,0,198,1,198,1,198,1,230,1,255,0,0,0};
// E
u8 code word8[]={0,0,0,0,0,0,0,0,255,0,198,1,102,0,102,0,126,0,102,0,102,0,6,0,134,1,198,1,255,0,0,0};
// Y
u8 code word9[]={0,0,0,0,0,0,0,0,239,1,198,0,238,0,108,0,124,0,56,0,56,0,56,0,56,0,56,0,124,0,0,0};
// O
u8 code word10[]={0,0,0,0,0,0,0,0,124,0,238,0,199,1,199,1,199,1,199,1,199,1,199,1,198,1,238,0,124,0,0,0};
// N
u8 code word11[]={0,0,0,0,0,0,0,0,231,3,206,0,206,0,222,0,254,0,254,0,246,0,230,0,230,0,198,0,207,0,0,0};
// D
u8 code word12[]={0,0,0,0,0,0,0,0,127,0,230,0,198,1,198,1,198,1,198,1,198,1,198,1,198,1,230,0,127,0,0,0};
// ^_^
u8 code word13[]={0,0,24,24,36,36,66,66,0,0,0,0,0,0,0,0,24,48,32,8,64,4,128,3,0,0,0,0,0,0,0,0};
//
void senddata(u8 dat1,u8 dat2,u8 dat3,u8 dat4)
{
u8 i;
sck=0; //sck高脉冲时数据送入寄存器
rck=0; //rck高脉冲送入寄存器存储的数据输出去
_nop_();
_nop_();
for(i=0;i<8;i++)
{
ser=dat1>>7;
dat1<<=1;
sck=1;
_nop_();
_nop_();
sck=0;
_nop_();
_nop_();
}
for(i=0;i<8;i++)
{
ser=dat2>>7;
dat2<<=1;
sck=1;
_nop_();
_nop_();
sck=0;
_nop_();
_nop_();
}
for(i=0;i<8;i++)
{
ser=dat3>>7;
dat3<<=1;
sck=1;
_nop_();
_nop_();
sck=0;
_nop_();
_nop_();
}
for(i=0;i<8;i++)
{
ser=dat4>>7;
dat4<<=1;
sck=1;
_nop_();
_nop_();
sck=0;
_nop_();
_nop_();
}
rck=1;
_nop_();
_nop_();
}
void main()
{
u8 i;
u16 j;
while(1)
{
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //永
{
senddata(~word1[i+1],~word1[i],word0[i],word0[i+1]);
}
}
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //远
{
senddata(~word2[i+1],~word2[i],word0[i],word0[i+1]);
}
}
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //的
{
senddata(~word3[i+1],~word3[i],word0[i],word0[i+1]);
}
}
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //黄
{
senddata(~word4[i+1],~word4[i],word0[i],word0[i+1]);
}
}
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //家
{
senddata(~word5[i+1],~word5[i],word0[i],word0[i+1]);
}
}
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //驹
{
senddata(~word6[i+1],~word6[i],word0[i],word0[i+1]);
}
}
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //B
{
senddata(~word7[i+1],~word7[i],word0[i],word0[i+1]);
}
}
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //E
{
senddata(~word8[i+1],~word8[i],word0[i],word0[i+1]);
}
}
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //Y
{
senddata(~word9[i+1],~word9[i],word0[i],word0[i+1]);
}
}
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //O
{
senddata(~word10[i+1],~word10[i],word0[i],word0[i+1]);
}
}
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //N
{
senddata(~word11[i+1],~word11[i],word0[i],word0[i+1]);
}
}
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //D
{
senddata(~word12[i+1],~word12[i],word0[i],word0[i+1]);
}
}
for(j=0;j<100;j++)
{
for(i=0;i<32;i+=2) //^_^
{
senddata(~word13[i+1],~word13[i],word0[i],word0[i+1]);
}
}
}
}
评论0