显示效果应该是 011111111 11111111 11111111 01111111 11111111 11111111
但是实际效果是 011111111 11111111 11111111 11111111 11111111 11111111
第二行应该是 101111111 11111111 11111111 10111111 11111111 11111111
实际效果是 101111111 11111111 11111111 01111111 11111111 11111111
导致最后显示到最后一个的时最后2个LED一起灭
void In_Data(unsigned char a,b,c)
{
unsigned char i,j,u;
for(u=0;u<6;u++)
{
if(u==0){j=a;}
if(u==1){j=b;}
if(u==2){j=c;}
if(u==3){j=a;}
if(u==4){j=b;}
if(u==5){j=c;}
for(i=0;i<8;i++)
{
j<<=1;
_nop_();_nop_();
Ds=CY;
_nop_();_nop_();
Sh=0;
_nop_();_nop_();
Sh=1;
}
}
St=0;
_nop_();_nop_();
St=1;
}
if(i==0){In_Data(0x7F,0xFF,0xFF);}//01111111 11111111 11111111
if(i==1 || i==45){In_Data(0xBF,0xFF,0xFF);}//10111111 11111111 11111111
if(i==2 || i==44){In_Data(0xDF,0xFF,0xFF);}//11011111 11111111 11111111
if(i==3 || i==43){In_Data(0xEF,0xFF,0xFF);}//11101111 11111111 11111111
if(i==4 || i==42){In_Data(0xF7,0xFF,0xFF);}//11110111 11111111 11111111
if(i==5 || i==41){In_Data(0xFB,0xFF,0xFF);}//11111011 11111111 11111111
if(i==6 || i==40){In_Data(0xFD,0xFF,0xFF);}//11111101 11111111 11111111
if(i==7 || i==39){In_Data(0xFE,0xFF,0xFF);}//11111110 11111111 11111111
if(i==8 || i==38){In_Data(0xFF,0x7F,0xFF);}//11111111 01111111 11111111
if(i==9 || i==37){In_Data(0xFF,0xBF,0xFF);}//11111111 10111111 11111111
if(i==10 || i==36){In_Data(0xFF,0xDF,0xFF);}//11111111 11011111 11111111
if(i==11 || i==35){In_Data(0xFF,0xEF,0xFF);}//11111111 11101111 11111111
if(i==12 || i==34){In_Data(0xFF,0xF7,0xFF);}//11111111 11110111 11111111
if(i==13 || i==33){In_Data(0xFF,0xFB,0xFF);}//11111111 11111011 11111111
if(i==14 || i==32){In_Data(0xFF,0xFD,0xFF);}//11111111 11111101 11111111
if(i==15 || i==31){In_Data(0xFF,0xFE,0xFF);}//11111111 11111110 11111111
if(i==16 || i==30){In_Data(0xFF,0xFF,0x7F);}//11111111 11111111 01111111
if(i==17 || i==29){In_Data(0xFF,0xFF,0xBF);}//11111111 11111111 10111111
if(i==18 || i==28){In_Data(0xFF,0xFF,0xDF);}//11111111 11111111 11011111
if(i==19 || i==27){In_Data(0xFF,0xFF,0xEF);}//11111111 11111111 11101111
if(i==20 || i==26){In_Data(0xFF,0xFF,0xF7);}//11111111 11111111 11110111
if(i==21 || i==25){In_Data(0xFF,0xFF,0xFB);}//11111111 11111111 11111011
if(i==22 || i==24){In_Data(0xFF,0xFF,0xFD);}//11111111 11111111 11111101
if(i==23){In_Data(0xFF,0xFF,0xFE);}//11111111 11111111 11111110
DelayMS(1200);
i++;
if(i==46){i=0;}
|