Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. int sensoreP = 2;
  2. int motB = 3;
  3. void setup() {
  4.     pinMode(sensoreP, INPUT);
  5.     pinMode(motB, OUTPUT);
  6. }
  7. void loop(){
  8.     digitalWrite(motB, HIGH);
  9.     delay(2000);
  10.     while (digitalRead(sensoreP) == 0) {
  11.         digitalWrite(motB, HIGH);
  12.     }
  13.     digitalWrite(motB, LOW);
  14.     delay(20000);
  15.    
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement