?? blinky.c
字號:
/* FLASH.C - LED Flasher for the Keil MCB251 Evaluation Board with 80C51 device*/
#include <REG51F.H>
void wait (void) { /* wait function */
; /* only to delay for LED flashes */
}
void main (void) {
unsigned int i; /* Delay var */
unsigned char j; /* LED var */
while (1) { /* Loop forever */
for (j=0x01; j< 0x80; j<<=1) { /* Blink LED 0, 1, 2, 3, 4, 5, 6 */
P1 = j; /* Output to LED Port */
for (i = 0; i < 10000; i++) { /* Delay for 10000 Counts */
wait (); /* call wait function */
}
}
for (j=0x80; j> 0x01; j>>=1) { /* Blink LED 6, 5, 4, 3, 2, 1 */
P1 = j; /* Output to LED Port */
for (i = 0; i < 10000; i++) { /* Delay for 10000 Counts */
wait (); /* call wait function */
}
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -