unsigned long t=0;
void setup() {
// put your setup code here, to run once:
pinMode(A1 , INPUT);
pinMode(3 , OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int PotContoler = analogRead(A1);
int angle = map(PotContoler, 0, 1023, 0, 180);
int rotation = map(angle, 0, 180, 500, 2500);
digitalWrite(3, HIGH);
if(micros() > rotation + t){
t=micros();
digitalWrite(3, LOW);
}
}