//输出为P1,P3 低电平有效.
#include
unsigned char code lyadsla[]=
{3,6,9,12,15,18,21,24,27,30,33,35,38,40,43,
45,47,49,51,53,54,56,57,59,60,61,62,62,63,63,63,
63,63,63,63,62,62,61,60,59,57,56,54,53,51,49,47,
45,43,40,38,35,33,30,27,24,21,18,15,12,9,6,3,0};
unsigned char code lyadslb[]=
{60,57,54,51,48,45,42,39,36,33,30,28,25,23,20,
18,16,14,12,10,9,7,6,4,3,2,1,1,0,0,0,
0,0,0,0,1,1,2,3,4,6,7,9,10,12,14,16,
18,20,23,25,28,30,33,36,39,42,45,48,51,54,57,60,63};
unsigned int i,j,ij,ji;
void main(void)
{
while(1)
{
P3=0xff;
ij=64;
while(ij--)
{
P1=0xff;
for(j=lyadslb[i];j>0;j--);
P1=0x00;
for(j=lyadsla[i];j>0;j--);
i++;
if(i>63)i=0;
}
P1=0xff;
ji=64;
while(ji--)
{
P3=0xff;
for(j=lyadslb[i];j>0;j--);
P3=0x00;
for(j=lyadsla[i];j>0;j--);
i++;
if(i>63)i=0;
}
}
}
杯具啊.600买的示波器就这样的效果.......哈哈