基于单片机人体感应智能台灯设计

1460下载地址 https://docs.qq.com/doc/DWEpnR2pOWU91b3p4?pub=1&dver=2.1.0

#include <reg52.h>

sbit key = P2^0;
sbit led = P1^0;

void delay_ms(unsigned int x);
void setup();

void main()
{
   setup();
   while(1)
   {
      if(key==1)
      {
	 led = 1;
	 delay_ms(1000);
	 led = 0;		   
      }
    }
}

void setup()

 

posted @ 2021-03-16 19:35  roadroad  阅读(178)  评论(0编辑  收藏  举报
电设屋
上千套电子毕设课设方案