wouldn't this result in a higher motor speed
int k = 9000 * analogRead(A0) / 1023;
int motor_speed = map(duration, 0, k, 255, 0);
wouldn't this result in a higher motor speed
int k = 9000 * analogRead(A0) / 1023;
int motor_speed = map(duration, 0, k, 255, 0);