scaling voltage with Op Amp for microcontrol
simulate this circuit &ndash; Schematic created using CircuitLab

First solve the transfer function in terms of non-inverting gain and offset.
Vout=(Vin-22)/2
   =Vin/2-11
   = (Vin/4)(1+|Av-|) -11V for Av-=-1   ( thus 4:1 divider and unity inverting gain )
  Vout = Vin/2 -11V
e.g. 22V/2-11=0
e.g. 32V/2-11=5