- #include "reg52.h"
- #include "intrins.h"
- typedef unsigned int u16; //对数据类型进行声明定义
- typedef unsigned char u8;
- sbit sw=P1^0;
- void Delay1000ms() //@11.0592MHz
- {
- unsigned char i, j, k;
- _nop_();
- _nop_();
- i = 43;
- j = 6;
- k = 203;
- do
- {
- do
- {
- while (--k);
- } while (--j);
- } while (--i);
- }
- void main()
- {
- sw=1;
- Delay1000ms();
- while(1)
- {
- sw=0;
- Delay1000ms();
- sw=1;
- Delay1000ms();
- }
- }
复制代码
|