却怎么都做不出来 ,led 上是没有一课亮的 ,,愿玩过普中开发板的大神 能给我解答一下
谢谢了
#include<reg51.h>
#include<intrins.h>
#include"dema.h"
#define uint unsigned int
#define uchar unsigned char
sbit MOSIO = P3^4;
sbit R_CLK = P3^5;
sbit S_CLK = P3^6;
void send(uchar dat0,uchar dat1,uchar dat2,uchar dat3 );
void main()
{
uchar k,l,j;
uchar *p[] =
{tab17, tab1, tab2, tab3, tab4, tab5, tab6, tab7, tab8,
tab9, tab10, tab11, tab12, tab13, tab14, tab15, tab16};
for(l=0;l<20;l++)
{
for(k=0;k<16;k++)
{
send(tab0[2*k],tab0[2*k + 1],(*(p[0] + 2*(k+j) + 1)),(*(p[0] + 2*(k+j) )) );
}
}
j++;
if(j == 96 )
{
j = 0;
}
}
void send(uchar BT3,uchar BT2,uchar BT1,uchar BT0 )
{
uchar i;
//--发送第一个字节--//
for(i=0;i<8;i++)
{
MOSIO = BT3 >> 7 ;//从高位到低位
BT3 <<= 1;
S_CLK = 0;
S_CLK = 1;
}
//--发送第一个字节--//
for(i=0;i<8;i++)
{
MOSIO = BT2 >>7;//从高位到低位
BT2 <<= 1;
S_CLK = 0;
S_CLK = 1;
}
//--发送第一个字节--//
for(i=0;i<8;i++)
{
MOSIO = BT1 >> 7;//从高位到低位
BT1 <<= 1;
S_CLK = 0;
S_CLK = 1;
}
//--发送第一个字节--//
for(i=0;i<8;i++)
{
MOSIO = BT0 >> 7;//从高位到低位
BT0 <<= 1;
S_CLK = 0;
S_CLK = 1;
}
//--输出--//
R_CLK = 0; //set dataline low
R_CLK = 1; //片选
R_CLK = 0; //
}
//点阵显示数组
unsigned char code tab0[] = {0xff, 0xfe, 0xff, 0xfd, 0xff, 0xfb, 0xff, 0xf7, 0xff, 0xef, 0xff, 0xdf, 0xff, 0xbf, 0xff, 0x7f,
0xfe, 0xff, 0xfd, 0xff, 0xfb, 0xff, 0xf7, 0xff, 0xef, 0xff, 0xdf, 0xff, 0xbf, 0xff, 0x7f, 0xff};
unsigned char code tab17[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
//纵向取模---亲---//
unsigned char code tab1[] = {0,2,0,1,252,63,16,8,32,4,248,31,0,1,0,1,254,127,0,1,32,25,24,17,8,33,0,1,0,0,0,0};
//------爱------//
unsigned char code tab2[] = {248,0,8,63,16,17,160,8,254,63,4,34,248,95,0,4,240,7,16,10,32,9,192,16,48,19,12,44,0,0,0,0};
unsigned char code tab3[] = {96,64,68,254,132,4,68,36,36,4,8,56,16,0,0,0,6,4,8,30,18,19,30,18,18,18,30,18,0,0,0,0};
unsigned char code tab4[] = {4,126,16,124,68,84,84,84,84,84,84,40,68,130,0,0,0,63,32,47,41,41,41,41,45,42,40,75,76,1,0,0};
unsigned char code tab5[] = {128,254,4,240,32,64,128,112,14,240,16,16,240,0,0,0,0,31,18,35,6,25,1,6,56,7,4,4,7,0,0,0};
unsigned char code tab6[] = {0,1,0,1,63,1,32,63,162,32,148,18,84,2,8,2,8,2,20,5,36,5,162,8,65,16,32,32,0,0,0,0};
unsigned char code tab7[] = {2,1,196,16,36,62,32,18,32,18,39,18,36,18,164,18,100,18,36,26,4,2,10,2,49,0,192,63,0,0,0,0};
unsigned char code tab8[] = {16,2,16,18,232,63,8,2,204,31,74,18,73,18,200,31,8,18,72,2,136,2,8,1,136,6,104,56,0,0,0,0};
unsigned char code tab9[] = {0,8,252,31,132,8,132,8,252,15,132,8,132,8,132,8,252,15,132,8,132,8,130,8,130,10,129,4,0,0,0,0};
unsigned char code tab10[] = {16,2,32,1,254,31,32,1,36,9,40,5,255,63,0,0,248,7,8,4,248,7,8,4,8,4,248,7,0,0,0,0};
unsigned char code tab11[] = {64,0,64,0,64,8,254,31,66,8,66,8,66,8,66,8,254,15,64,0,64,0,64,0,64,0,64,0,0,0,0,0};
unsigned char code tab12[] = {0,8,254,31,16,2,16,2,16,2,16,18,255,63,16,2,16,2,16,2,16,2,8,2,4,2,3,2,0,0,0,0};
unsigned char code tab13[] = {32,2,36,4,36,4,34,16,254,63,32,0,224,15,80,8,80,4,136,2,8,1,132,2,98,60,29,16,0,0,0,0};
unsigned char code tab14[] = {4,8,4,30,196,1,95,0,196,15,68,8,78,9,86,9,69,5,69,5,68,2,36,5,164,56,84,16,0,0,0,0};
unsigned char code tab15[] = {0,0,0,0,60,240,102,156,67,130,0,0,0,0,0,0,0,0,0,0,48,24,96,8,192,7,0,0,0,0,0,0};
unsigned char code tab16[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
谢谢了
#include<reg51.h>
#include<intrins.h>
#include"dema.h"
#define uint unsigned int
#define uchar unsigned char
sbit MOSIO = P3^4;
sbit R_CLK = P3^5;
sbit S_CLK = P3^6;
void send(uchar dat0,uchar dat1,uchar dat2,uchar dat3 );
void main()
{
uchar k,l,j;
uchar *p[] =
{tab17, tab1, tab2, tab3, tab4, tab5, tab6, tab7, tab8,
tab9, tab10, tab11, tab12, tab13, tab14, tab15, tab16};
for(l=0;l<20;l++)
{
for(k=0;k<16;k++)
{
send(tab0[2*k],tab0[2*k + 1],(*(p[0] + 2*(k+j) + 1)),(*(p[0] + 2*(k+j) )) );
}
}
j++;
if(j == 96 )
{
j = 0;
}
}
void send(uchar BT3,uchar BT2,uchar BT1,uchar BT0 )
{
uchar i;
//--发送第一个字节--//
for(i=0;i<8;i++)
{
MOSIO = BT3 >> 7 ;//从高位到低位
BT3 <<= 1;
S_CLK = 0;
S_CLK = 1;
}
//--发送第一个字节--//
for(i=0;i<8;i++)
{
MOSIO = BT2 >>7;//从高位到低位
BT2 <<= 1;
S_CLK = 0;
S_CLK = 1;
}
//--发送第一个字节--//
for(i=0;i<8;i++)
{
MOSIO = BT1 >> 7;//从高位到低位
BT1 <<= 1;
S_CLK = 0;
S_CLK = 1;
}
//--发送第一个字节--//
for(i=0;i<8;i++)
{
MOSIO = BT0 >> 7;//从高位到低位
BT0 <<= 1;
S_CLK = 0;
S_CLK = 1;
}
//--输出--//
R_CLK = 0; //set dataline low
R_CLK = 1; //片选
R_CLK = 0; //
}
//点阵显示数组
unsigned char code tab0[] = {0xff, 0xfe, 0xff, 0xfd, 0xff, 0xfb, 0xff, 0xf7, 0xff, 0xef, 0xff, 0xdf, 0xff, 0xbf, 0xff, 0x7f,
0xfe, 0xff, 0xfd, 0xff, 0xfb, 0xff, 0xf7, 0xff, 0xef, 0xff, 0xdf, 0xff, 0xbf, 0xff, 0x7f, 0xff};
unsigned char code tab17[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
//纵向取模---亲---//
unsigned char code tab1[] = {0,2,0,1,252,63,16,8,32,4,248,31,0,1,0,1,254,127,0,1,32,25,24,17,8,33,0,1,0,0,0,0};
//------爱------//
unsigned char code tab2[] = {248,0,8,63,16,17,160,8,254,63,4,34,248,95,0,4,240,7,16,10,32,9,192,16,48,19,12,44,0,0,0,0};
unsigned char code tab3[] = {96,64,68,254,132,4,68,36,36,4,8,56,16,0,0,0,6,4,8,30,18,19,30,18,18,18,30,18,0,0,0,0};
unsigned char code tab4[] = {4,126,16,124,68,84,84,84,84,84,84,40,68,130,0,0,0,63,32,47,41,41,41,41,45,42,40,75,76,1,0,0};
unsigned char code tab5[] = {128,254,4,240,32,64,128,112,14,240,16,16,240,0,0,0,0,31,18,35,6,25,1,6,56,7,4,4,7,0,0,0};
unsigned char code tab6[] = {0,1,0,1,63,1,32,63,162,32,148,18,84,2,8,2,8,2,20,5,36,5,162,8,65,16,32,32,0,0,0,0};
unsigned char code tab7[] = {2,1,196,16,36,62,32,18,32,18,39,18,36,18,164,18,100,18,36,26,4,2,10,2,49,0,192,63,0,0,0,0};
unsigned char code tab8[] = {16,2,16,18,232,63,8,2,204,31,74,18,73,18,200,31,8,18,72,2,136,2,8,1,136,6,104,56,0,0,0,0};
unsigned char code tab9[] = {0,8,252,31,132,8,132,8,252,15,132,8,132,8,132,8,252,15,132,8,132,8,130,8,130,10,129,4,0,0,0,0};
unsigned char code tab10[] = {16,2,32,1,254,31,32,1,36,9,40,5,255,63,0,0,248,7,8,4,248,7,8,4,8,4,248,7,0,0,0,0};
unsigned char code tab11[] = {64,0,64,0,64,8,254,31,66,8,66,8,66,8,66,8,254,15,64,0,64,0,64,0,64,0,64,0,0,0,0,0};
unsigned char code tab12[] = {0,8,254,31,16,2,16,2,16,2,16,18,255,63,16,2,16,2,16,2,16,2,8,2,4,2,3,2,0,0,0,0};
unsigned char code tab13[] = {32,2,36,4,36,4,34,16,254,63,32,0,224,15,80,8,80,4,136,2,8,1,132,2,98,60,29,16,0,0,0,0};
unsigned char code tab14[] = {4,8,4,30,196,1,95,0,196,15,68,8,78,9,86,9,69,5,69,5,68,2,36,5,164,56,84,16,0,0,0,0};
unsigned char code tab15[] = {0,0,0,0,60,240,102,156,67,130,0,0,0,0,0,0,0,0,0,0,48,24,96,8,192,7,0,0,0,0,0,0};
unsigned char code tab16[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};