Guest User

Untitled

a guest
Apr 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <Servo.h>
  2.  
  3. Servo myServo;
  4.  
  5. void setup() {
  6. Serial.begin(9600);
  7. myServo.attach(3);
  8.  
  9. }
  10.  
  11. void loop() {
  12. int sensor = analogRead(A0);
  13.  
  14. Serial.println(sensor);
  15.  
  16. int angle = map(sensor, 0, 974, 0, 179);
  17. // if (millis() % 20 < 2){
  18. myServo.write(angle);
  19. // }
  20. // delay(20);
  21.  
  22. }
Add Comment
Please, Sign In to add comment