|
#include<reg52.h> //包含51单片机寄存器的头文件
#define uint unsigned int
#define uchar unsigned char
unsigned char data addata;
unsigned char xdata *Address = 0xBFFF;
void delay_ms(unsigned int timer) //延时函数
{
unsigned char j=0;
while(timer--)
{
for(j=124;j>0;j--){;}
}
}
void main()
{
addata = 0xff;
while(1)
{
*Address = 0x00;
delay_ms(10);
*Address = 0xff;
delay_ms(30);
}
}
|
|