【LED 点阵】

1 #include <reg54.h> 2 #include <intrins.h> 3 4 void delay(uint z) 5 { 6 uint x,y; 7 for(x=z;x>0;x--) 8 for(y=114;y>0;y--); 9 } 10 11 12 void main() 13 { 14 uchar i,x=0x01,j=0xfe; 15 16 17 18 while(1) 19 { 20 for(i=0;i<8;i++) 21 { 22 23 P1 = 0xE7; //1110 0111 低电平位选中 【行】 24 P2 = 0x18; // 0001 1000 高电平选中 【列】 25 delay(500); 26 27 } 28 29 } 30 31 32 33 }
一个二次元的生物

浙公网安备 33010602011771号