1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| #include <REGX52.H> #include <INTRINS.H>
void Delay500ms(){ unsigned char i,j,k; _nop_(); i = 4; j= 205; k = 187; do{ do{ while(--k); }while(--j); }while(--i); }
void main(){
while(1){ P2=0xfe; Delay500ms(); P2=0xfd; Delay500ms(); P2=0xfb; Delay500ms(); P2=0xf7; Delay500ms(); P2=0xef; Delay500ms(); P2=0xdf; Delay500ms(); P2=0xbf; Delay500ms(); P2=0x7f; Delay500ms(); } }
|