?? thefirstexampleok.c
字號:
/**********************************************
* File: TheFirstExampleOK.c
* Description: The first delay example
* Created Date: 2007-09-04
* Last Modified: 2007-09-04
* Author: Jeffrey - Schicksal@126.com
* Notes: None
**********************************************/
#include <REGX51.h>
#define LED_FLASH_T 10000;
/**********************************************
* Function: delay(unsigned int t)
* Input Variables: t
* Return Variables: None
* Usage: Common Delay Routine, t as the delay time ticks
**********************************************/
void delay(unsigned int t)
{
for(;t>0;t--); // 延時循環
}
/**********************************************
* Function: main()
* Input Variables: None
* Return Variables: None
* Usage: Program Entry
**********************************************/
void main()
{
while(1)
{
P0 = 0x00; // P0口輸出電平低
delay(LED_FLASH_T);
P0 = 0xff; // P0口輸出電平高
delay(LED_FLASH_T);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -