#include <Servo.h>
#define POT_REG_MAX 270.0
Servo servak;
void setup() {
// put your setup code here, to run once:
servak.attach(3);
}
void loop() {
// put your main code here, to run repeatedly:
int value = analogRead(A7);
int angle = int(value / 1024.0 * POT_REG_MAX );
for(int i = 0; i <= angle; i++){
angle = constrain(angle, 0 , 180);
servak.write(i);
}
}