zed_com

Проект "Автоматическая дверь"

Jun 15th, 2020
1,039
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <Servo.h>
  2. Servo servo_3;
  3. Servo servo_5;
  4.  
  5. void setup()
  6. {
  7.   servo_3.attach(3);
  8.   servo_5.attach(5);
  9.   pinMode(6, INPUT);
  10. }
  11.  
  12. void loop()
  13. {
  14.   servo_3.write(90);
  15.   servo_5.write(90);
  16.   if (digitalRead(6) == 1) {
  17.     servo_3.write(0);
  18.     servo_5.write(0);
  19.     delay(5000);
  20.   }
  21.  
  22.   delay(10);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment