#include"REG51.H"
unsigned int m,n,k,p,x,y;
unsigned char hang[8]={0X80,0X40,0X20,0X10,0X08,0X04,0X02,0X01};
unsigned char cot[69]={0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XE7,
0X00,0X00,0X66,0X7E,0X81,0XC3,0XFF,0X3F,0X3F,0X00, 0X00,0X3F,0X3F,
0XFF,0X99,0X3C,0X2C,0X24,0X91,0XFF,0XE7,0XE7,0XE7, 0XFF,0X00,0X00,
0XC7,0X93,0X39,0X7C,0XFF,0X99,0X3C,0X2C,0X24,0X91, 0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF};
void delay(unsigned int t)
{
unsigned int i,j;
for(i=0;i<=t;i++)
for(j=0;j<=125;j++);
}
void scan(void)
{
P3=hang[n];
if(p<=53) P2=cot[p];
if(p>8) P1=cot[p-8];
if(p>16) P0=cot[p-16];
}
void main(void)
{
m=0;
while(1)
{
for(k=1;k<=5;k++)
{
for(n=0;n<=7;n++)
{
p=n+m;
scan();
delay(2);
}
}
delay(10);
m++;
if(m==69) m=0;
}
}
đây là đoạn code hiển thị chữ chạy mình copy trên mạng.có đoạn sau mình không hiểu nó như thế nào
void scan(void)
{
P3=hang[n];
if(p<=53) P2=cot[p];
if(p>8) P1=cot[p-8];
if(p>16) P0=cot[p-16];
}
cách dịch giữa các led là như thế nào
unsigned int m,n,k,p,x,y;
unsigned char hang[8]={0X80,0X40,0X20,0X10,0X08,0X04,0X02,0X01};
unsigned char cot[69]={0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XE7,
0X00,0X00,0X66,0X7E,0X81,0XC3,0XFF,0X3F,0X3F,0X00, 0X00,0X3F,0X3F,
0XFF,0X99,0X3C,0X2C,0X24,0X91,0XFF,0XE7,0XE7,0XE7, 0XFF,0X00,0X00,
0XC7,0X93,0X39,0X7C,0XFF,0X99,0X3C,0X2C,0X24,0X91, 0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF};
void delay(unsigned int t)
{
unsigned int i,j;
for(i=0;i<=t;i++)
for(j=0;j<=125;j++);
}
void scan(void)
{
P3=hang[n];
if(p<=53) P2=cot[p];
if(p>8) P1=cot[p-8];
if(p>16) P0=cot[p-16];
}
void main(void)
{
m=0;
while(1)
{
for(k=1;k<=5;k++)
{
for(n=0;n<=7;n++)
{
p=n+m;
scan();
delay(2);
}
}
delay(10);
m++;
if(m==69) m=0;
}
}
đây là đoạn code hiển thị chữ chạy mình copy trên mạng.có đoạn sau mình không hiểu nó như thế nào
void scan(void)
{
P3=hang[n];
if(p<=53) P2=cot[p];
if(p>8) P1=cot[p-8];
if(p>16) P0=cot[p-16];
}
cách dịch giữa các led là như thế nào
Comment