#include<Servo.h>
Servo FS90;
byte FS90Pin = 9;
byte analogPinA0 = A0;
int position;
void setup() {
FS90.attach(FS90Pin, 500, 2500);
Serial.begin(9600);
}
void loop() {
while (1) {
position = analogRead(analogPinA0);
position = map(position, 0, 1023, 0, 180); //ou position = position*0.176
Serial.print("position= ");
Serial.println(position);
FS90.write(position);
}
}