def set_pin_interpolation(self,<EOL>pin,<EOL>read_min,<EOL>read_max,<EOL>write_min,<EOL>write_max):
if type(pin) is list:<EOL><INDENT>args = (read_min, read_max, write_min, write_max)<EOL>for p in pin:<EOL><INDENT>self.set_pin_interpolation(p, *args)<EOL><DEDENT>return<EOL><DEDENT>valid_read = (read_min is not None and read_max is not None)<EOL>valid_write = (write_min is not None and write_max is not None)<EOL>if not valid_read and not valid_write:<EOL><INDENT>self._pin_lin.pop(pin, None)<EOL>return<EOL><DEDENT>pin_id = self._pin_mapping.get(pin, None)<EOL>pins = [pin for pin in self.available_pins() if pin_id == pin['<STR_LIT:id>']]<EOL>read = pins[<NUM_LIT:0>]['<STR_LIT>']['<STR_LIT>']<EOL>write = pins[<NUM_LIT:0>]['<STR_LIT>']['<STR_LIT>']<EOL>valid_read = valid_read and read<EOL>valid_write = valid_write and write<EOL>self._pin_lin[pin] = {<EOL>'<STR_LIT>': (*read, read_min, read_max) if valid_read else None,<EOL>'<STR_LIT>': (write_min, write_max, *write) if valid_write else None<EOL>}<EOL>
Interpolates input and output values for `pin`.

        Changes the output and input of `AbstractDriver.read` and
        `AbstractDriver.write` functions to use a value in range
        (`read_min`, `read_max`) or (`write_min`, `write_max`) instead of the
        values returned by `available_pins` (analog only). The conversion is
        done using linear interpolation. If `read_min`, `read_max`, `write_min`
        and `write_max` are all None or don't form valid pairs (like, read_min
        has a value but read_max is None), the pin is deregistered. If you pass
        a pair but leave the other with None values, only one direction is
        registered.

        @arg pin pin id you've set using `AbstractDriver.map_pin`
        @arg read_min the min value for the linear interpolation of
             `AbstractDriver.read`.
        @arg read_max the max value for the linear interpolation of
             `AbstractDriver.read`.
        @arg write_min the min value for the linear interpolation of
             `AbstractDriver.write`.
        @arg write_max the max value for the linear interpolation of
             `AbstractDriver.write`.