📄 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 + -