#include <Servo.h>
Servo PorServo;
void setup() {
Serial.begin(9600);
PorServo.attach(3);
PorServo.write(90);
}
void loop() {
int Val = analogRead(A0);
int MapVal = map(Val, 0, 1023, 0, 180);
PorServo.write(MapVal);
delay(10);
}
#include <Servo.h>
Servo PorServo;
void setup() {
Serial.begin(9600);
PorServo.attach(3);
PorServo.write(90);
}
void loop() {
int Val = analogRead(A0);
int MapVal = map(Val, 0, 1023, 0, 180);
PorServo.write(MapVal);
delay(10);
}