I am controlling 2 servos from a pot
where i map the values of the pot as follows
int hori=analogRead(poth);
int pos = map(hori,0,1023,40,180); //Dont want the servo output ever to be zero
myservo1.write(pos);
myservo2.write(pos);
I wanna control another servo with the same pot readings
but in the opposite direction(inverse readings)
eg when the first servo has 40 as reading the other should have 180 and the vice versa
and the corresponding in between readings
int hori=analogRead(poth);
int pos = map(hori,0,1023,40,180); //Dont want the servo output ever to be zero
myservo1.write(pos);
myservo2.write(180-pos); // <== Note this change
Of course, in this variation you do not have the "pos" variable, if you want to do more with it
Servos are not necessarily identical, especially mounting the horn (the bit you screw on the axle) is often off by a degree or two, so you want to "trim". In this case after carefully fiddling with your mechanical setup (assuming it is accuracy you need), your code might be "trimmed" with (example values)