cpp
#include "reg51.h"
//#include "myh.h"
int main()
{
int row=0,col=0;
int i=0;
int leda[8]={0,~0x81,~0x81,~0x81,~0x81,~0x81,~0x81,0 };
int ledb[8]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80 };
while(1)
{
for(row=0;row<8;row++)
{
P2=leda[row] ;
P3=ledb[row] ;
sleep(100);
P2=0XFF;
}
};
return 0;
}
void sleep(long int a)
{
long int i=0;
for(i=0;i<a;i++)
{
;
}
}