Feb 2, 2000 #2 W wizpic Guest 在这里你去 代码: / /包含文件 #包括<pic.h>/ / 16F84配置 __CONFIG(0x3FF1);#定义PORTBIT(美国存托凭证,位)((符号)(&美国存托凭证)* 8 (位))@ PORTBIT(PORTB的,0)静态位LED0; @ PORTBIT(PORTB的,1)静态位LED1; @ PORTBIT(PORTB的,2)静态位LED2; @ PORTBIT(PORTB的,3)静态位LED3; @ PORTBIT(PORTB的,4)静态位LED4; @ PORTBIT(PORTB的,5)静态位LED5; @ PORTBIT(PORTB的,6)静态位LED6; @ PORTBIT(PORTB的,7)静态位LED7;无符号整型一; / /循环暂停 无符号整型荤/ /循环事件循环/ /暂停功能 无效pause_1(); 无效pause_2();/ /主要功能 无效的主要(无效) (TRISB = 0x00; PORTB的= 0b00000000;而(1) (对(c = 0;荤“10; C 中) (/ /向前 LED0 = 1; pause_1();LED0 = 0; LED1 = 1; pause_1();LED1 = 0; LED2 = 1; pause_1();LED2 = 0; LED3 = 1; pause_1();LED3 = 0; LED4 = 1; pause_1();LED4 = 0; LED5 = 1; pause_1();LED5 = 0; LED6 = 1; pause_1();LED6 = 0; LED7 = 1; pause_1();LED7 = 0;/ /反向 LED6 = 1; pause_1();LED6 = 0; LED5 = 1; pause_1();LED5 = 0; LED4 = 1; pause_1();LED4 = 0; LED3 = 1; pause_1();LED3 = 0; LED2 = 1; pause_1();LED2 = 0; LED1 = 1; pause_1();LED1 = 0; LED0 = 1; pause_1(););/ /重新PORTB的initalize PORTB的= 0b00000000;对(c = 0;荤“10; C 中) (PORTB的= 0b10101010; pause_2();PORTB的= 0b01010101; pause_2(););对(c = 0;荤“10; C 中) (PORTB的= 0b11110000; pause_2();PORTB的= 0b00001111; pause_2(););对(c = 0;荤“10; C 中) (PORTB的= 0b11001100; pause_2();PORTB的= 0b00110011; pause_2(););对(c = 0;荤“10; C 中) (PORTB的= 0b10000001; pause_1();PORTB的= 0b01000010; pause_1();PORTB的= 0b00100100; pause_1();PORTB的= 0b00011000; pause_1();PORTB的= 0b00100100; pause_1();PORTB的= 0b01000010; pause_1(););))无效pause_1() (为(1 = 0;“4000,我 ); 为(1 = 0;“4000,我 ););无效pause_2() (为(1 = 0;“4000,我 ); 为(1 = 0;“4000,我 ); 为(1 = 0;“4000,我 ); 为(1 = 0;“4000,我 ); 为(1 = 0;“4000,我 ); 为(1 = 0;“4000,我 ););
在这里你去 代码: / /包含文件 #包括<pic.h>/ / 16F84配置 __CONFIG(0x3FF1);#定义PORTBIT(美国存托凭证,位)((符号)(&美国存托凭证)* 8 (位))@ PORTBIT(PORTB的,0)静态位LED0; @ PORTBIT(PORTB的,1)静态位LED1; @ PORTBIT(PORTB的,2)静态位LED2; @ PORTBIT(PORTB的,3)静态位LED3; @ PORTBIT(PORTB的,4)静态位LED4; @ PORTBIT(PORTB的,5)静态位LED5; @ PORTBIT(PORTB的,6)静态位LED6; @ PORTBIT(PORTB的,7)静态位LED7;无符号整型一; / /循环暂停 无符号整型荤/ /循环事件循环/ /暂停功能 无效pause_1(); 无效pause_2();/ /主要功能 无效的主要(无效) (TRISB = 0x00; PORTB的= 0b00000000;而(1) (对(c = 0;荤“10; C 中) (/ /向前 LED0 = 1; pause_1();LED0 = 0; LED1 = 1; pause_1();LED1 = 0; LED2 = 1; pause_1();LED2 = 0; LED3 = 1; pause_1();LED3 = 0; LED4 = 1; pause_1();LED4 = 0; LED5 = 1; pause_1();LED5 = 0; LED6 = 1; pause_1();LED6 = 0; LED7 = 1; pause_1();LED7 = 0;/ /反向 LED6 = 1; pause_1();LED6 = 0; LED5 = 1; pause_1();LED5 = 0; LED4 = 1; pause_1();LED4 = 0; LED3 = 1; pause_1();LED3 = 0; LED2 = 1; pause_1();LED2 = 0; LED1 = 1; pause_1();LED1 = 0; LED0 = 1; pause_1(););/ /重新PORTB的initalize PORTB的= 0b00000000;对(c = 0;荤“10; C 中) (PORTB的= 0b10101010; pause_2();PORTB的= 0b01010101; pause_2(););对(c = 0;荤“10; C 中) (PORTB的= 0b11110000; pause_2();PORTB的= 0b00001111; pause_2(););对(c = 0;荤“10; C 中) (PORTB的= 0b11001100; pause_2();PORTB的= 0b00110011; pause_2(););对(c = 0;荤“10; C 中) (PORTB的= 0b10000001; pause_1();PORTB的= 0b01000010; pause_1();PORTB的= 0b00100100; pause_1();PORTB的= 0b00011000; pause_1();PORTB的= 0b00100100; pause_1();PORTB的= 0b01000010; pause_1(););))无效pause_1() (为(1 = 0;“4000,我 ); 为(1 = 0;“4000,我 ););无效pause_2() (为(1 = 0;“4000,我 ); 为(1 = 0;“4000,我 ); 为(1 = 0;“4000,我 ); 为(1 = 0;“4000,我 ); 为(1 = 0;“4000,我 ); 为(1 = 0;“4000,我 ););