SHARE
TWEET

Untitled

a guest Oct 29th, 2016 145 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #include <Servo.h>
  3. Servo myservo;
  4.  
  5.  
  6. void setup() {
  7.   pinMode(8, INPUT);
  8.   myservo.attach(9);
  9. }
  10.  
  11. void loop() {
  12.  int val = digitalRead(8);
  13.  
  14.  if (val == HIGH){
  15.   myservo.write(80);
  16.  
  17.  }
  18.  else if (val == LOW){
  19.   myservo.write(138);
  20.  }
  21.  
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top