I have a servo that rotates against the number that I get from the program. The numbers that I get from the program are 37 ... 113. I need to translate 37 to the opposite side. Thus, 37 becomes 113, 38 becomes 112, etc. 75 remains at 75 because the midpoint.
Do any of you know a way to calculate this? It sounds like simple math, but I can't figure it out. I do not want to use a lookup table because the range may change.
source share