Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Servo.h>
- Servo myservo;
- int servoPin = 13;
- int potPin = 3;
- int potVal;
- void setup() {
- myservo.attach(servoPin);
- }
- void loop() {
- potVal = analogRead(potPin);
- potVal = map(potVal, 0, 1023, 0, 180);
- myservo.write(potVal);
- delay(15);
- }
Advertisement
Add Comment
Please, Sign In to add comment