标签:bit def reg 时序 独立 lang delay include sig
//二极管闪烁
#include<reg52.h>
sbit p1_1=P1^0;
unsigned int a;
void main()
{
while(1)
{
a=50000;
p1_1=0;
while(a--);
a=50000;
p1_1=1;
while(a--);
}
}
#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
sbit D1=P1^0;
void delay();
void main()
{
while(1)
{
D1=0;
delay();
D1=1;
delay();
}
}
void delay()
{
uint x,y;
for(x=100;x>0;x--)
{
for(y=600;y>0;y--)
{
};
};
}
#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
sbit D1=P1^0;
//void delay();
void delay(uint);
void main()
{
while(1)
{
D1=0;
delay(1);
D1=1;
delay(1);
}
}
/*-------------------------------------------------
void delay()
{
uint x,y;
for(x=100;x>0;x--)
{
for(y=600;y>0;y--)
{
};
};
----------------------------------------------------*/
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
{
for(y=100;y>0;y--)
{
};
};
}
#include<reg52.h>
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
void delay(uint);
uchar temp;
void main()
{
temp=0xfe;
P1=temp;
while(1)
{
temp=_crol_(temp,1);
delay(600);
P1=temp;
}
}
/*-------------------------------------------------
void delay()
{
uint x,y;
for(x=100;x>0;x--)
{
for(y=600;y>0;y--)
{
};
};
----------------------------------------------------*/
void delay(uint z)
{
uint x,y;
for(x=100;x>0;x--)
{
for(y=z;y>0;y--)
{
};
};
}
标签:bit def reg 时序 独立 lang delay include sig
原文地址:https://www.cnblogs.com/xiaoheng2020/p/14944152.html