def bitsToVolts(self, chnum, chgain, bits):
        """
        Name: U12.bitsToVolts(chnum, chgain, bits)
        Args: See section 4.14 of the User's Guide
        Desc: Converts a 12-bit (0-4095) binary value into a LabJack voltage. No hardware communication is involved.

        >>> dev = U12()
        >>> dev.bitsToVolts(0, 0, 2662)
        >>> {'volts': 2.998046875}
        """
        if ON_WINDOWS:
            volts = ctypes.c_float()
            ecode = staticLib.BitsToVolts(chnum, chgain, bits, ctypes.byref(volts))
    
            if ecode != 0: print(ecode)
    
            return volts.value
        else:
            if chnum < 8:
                return ( float(bits) * 20.0 / 4096.0 ) - 10.0
            else:
                volts = ( float(bits) * 40.0 / 4096.0 ) - 20.0
                return volts / self.GainMapping[chgain]
dataset/ETHPy150Open LabPy/lantz/lantz/drivers/labjack/_internal/u12.py/U12.bitsToVolts/original