Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <PWMServo.h>
  2. PWMServo myservo;
  3. int pos = 0;
  4. int buttonState = 8;
  5. void setup() {
  6. pinMode(9, OUTPUT);
  7. pinMode(8, INPUT);
  8. pinMode(2, OUTPUT);
  9. Serial.begin(9600);
  10. myservo.attach(2);
  11.  
  12. }
  13.  
  14. void loop() {
  15. if(buttonState = 1023)
  16. { digitalWrite(8, HIGH);
  17. else digitalWrite(8, LOW);
  18.  
  19.  
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement