#include "Servo.h"
Servo servo;
int potPin = 0;
int servoPin = 3;
int potVal;
void setup() {
servo.attach(servoPin);
}
void loop() {
potVal = analogRead(potPin);
potVal = map(potVal, 0, 1023, 0, 180);
servo.write(potVal);
delay(15);
}
Copyright ⓒ TECH79 All right reserved