当前位置:网站首页>Arduino droplet detection

Arduino droplet detection

2022-07-07 03:47:00 ljsz36

Physical connection diagram :

Circuit diagram :

Code :

void setup() {
  pinMode(3, OUTPUT);
  pinMode(2, INPUT);
}

void loop() {
  bool va2 = digitalRead(2);
  if (va2 == 1)
  {
    digitalWrite(3, 0);
  }
  else
  {
    digitalWrite(3, 1);
  }
}

Use effect :

Arduino Water drop detection

原网站

版权声明
本文为[ljsz36]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130824104029.html