单片机-长按点亮

#include <reg51.h>
sbit bt=P1^0;

void main()
{
 while(1)
 {
  if(bt==0)
 {
  P2=0x00;
 }
 else
 {
  P2=0xFF;
  }
 }
}

  

posted @ 2021-10-12 15:00  小kBlog  阅读(132)  评论(0编辑  收藏  举报