#include <Servo.h>
byte sensorPin = A0;
byte motorPin = 3;
Servo motor;
int posMotor = 0;
void setup() {
// put your setup code here, to run once:
motor.attach(motorPin);
}
void loop() {
// put your main code here, to run repeatedly:
double sensorValue = analogRead(sensorPin);
posMotor = (sensorValue/1023)*180;
motor.write(posMotor);
delay(25);
}