1. #define PIN_NUM 2  
  2.   
  3. void setup()  {  
  4.   Serial.begin(9600);  
  5.   pinMode(PIN_NUM,INPUT);  
  6. }  
  7.   
  8. void loop()  {  
  9.   if(digitalRead(PIN_NUM)==HIGH){  
  10.     Serial.println("Someone here!");  
  11.   }     
  12.   else {  
  13.     Serial.println("Nobody");  
  14.   }  
  15.   delay(1000);  
  16. }
  17.   Arduino-----人体传感器

相关文章:

  • 2021-03-31
  • 2021-10-09
  • 2021-06-25
  • 2022-12-23
  • 2021-09-22
  • 2021-11-18
  • 2021-11-18
  • 2021-07-31
猜你喜欢
  • 2021-08-04
  • 2022-02-06
  • 2021-05-30
  • 2021-11-18
  • 2021-11-18
  • 2021-12-03
  • 2021-04-06
相关资源
相似解决方案