các pro ơi giải thích hộ em đoạn code này với.e xin cảm ơn nhiều!
em copy được trên machdientu.net nhưng chưa hiểu
chạy chữT3-K3
#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)
{
}
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;
}
}
em copy được trên machdientu.net nhưng chưa hiểu
chạy chữT3-K3
#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)
{
}
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;
}
}
Comment