fix correctly
This commit is contained in:
81
led.c
81
led.c
@ -3,67 +3,36 @@
|
||||
|
||||
bit lightoff = 1;
|
||||
bit lighton = 0;
|
||||
sbit P1_0 = P1^0;
|
||||
sbit P1_1 = P1^1;
|
||||
sbit P1_2 = P1^2;
|
||||
sbit P1_3 = P1^3;
|
||||
sbit P1_4 = P1^4;
|
||||
sbit P1_5 = P1^5;
|
||||
sbit P1_6 = P1^6;
|
||||
sbit P1_7 = P1^7;
|
||||
|
||||
char code LED_light[17] = {
|
||||
~0x00,
|
||||
~0x01,
|
||||
~0x02,
|
||||
~0x04,
|
||||
~0x08,
|
||||
~0x10,
|
||||
~0x20,
|
||||
~0x40,
|
||||
~0x80,
|
||||
~0x40,
|
||||
~0x20,
|
||||
~0x10,
|
||||
~0x08,
|
||||
~0x04,
|
||||
~0x02,
|
||||
~0x01
|
||||
};
|
||||
|
||||
void delay_1500ms();
|
||||
|
||||
int main () {
|
||||
P1 = 0xFF;
|
||||
while (1) {
|
||||
while (1)
|
||||
// ********* <20><><EFBFBD>@ LED *********
|
||||
for(LED_mode = 0; LED_mode < 16; LED_mode++) {
|
||||
P1 = LED_light[LED_mode];
|
||||
}
|
||||
delay_1500ms();
|
||||
|
||||
P1_0 = lighton;
|
||||
delay_1500ms();
|
||||
|
||||
P1_1 = lighton;
|
||||
delay_1500ms();
|
||||
|
||||
P1_2 = lighton;
|
||||
delay_1500ms();
|
||||
|
||||
P1_3 = lighton;
|
||||
delay_1500ms();
|
||||
|
||||
P1_4 = lighton;
|
||||
delay_1500ms();
|
||||
|
||||
P1_5 = lighton;
|
||||
delay_1500ms();
|
||||
|
||||
P1_6 = lighton;
|
||||
delay_1500ms();
|
||||
|
||||
P1_7 = lighton;
|
||||
delay_1500ms();
|
||||
|
||||
P1_7 = lightoff;
|
||||
delay_1500ms();
|
||||
|
||||
P1_6 = lightoff;
|
||||
delay_1500ms();
|
||||
|
||||
P1_5 = lightoff;
|
||||
delay_1500ms();
|
||||
|
||||
P1_4 = lightoff;
|
||||
delay_1500ms();
|
||||
|
||||
P1_3 = lightoff;
|
||||
delay_1500ms();
|
||||
|
||||
P1_2 = lightoff;
|
||||
delay_1500ms();
|
||||
|
||||
P1_1 = lightoff;
|
||||
delay_1500ms();
|
||||
|
||||
P1_0 = lightoff;
|
||||
} // end of while(1)
|
||||
} // end of main()
|
||||
|
||||
|
Reference in New Issue
Block a user