C言語プログラミングシングルチップケース点滅LED

 

#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit LED = P1^0;

void DelayMS(uint x)
{
 	uchar i;
	while(x--)
	{
	 	for(i=120;i>0;i--);
	}
}

void main()
{
 	while(1)
	{
	 	LED = ~LED;
		DelayMS(150);
	}
}

シミュレーション+ソースコードはhttps://download.csdn.net/download/qq_30787727/14927150にあります

詳細については、パブリックアカウントZhongluXiaomaをフォローしてください

おすすめ

転載: blog.csdn.net/qq_30787727/article/details/113077013