pyadi-iio icon indicating copy to clipboard operation
pyadi-iio copied to clipboard

AD5686 - get and set channel volts is inconsistent

Open brunolalb opened this issue 6 months ago • 0 comments

Setting the voltage of a channel has to be done in volts, but getting returns it in milivolts. See the getter and setter function (ad5686.py at line 118):

      def to_raw(self, val):
            """Converts raw value to SI"""
            return int(1000.0 * val / self.scale)

        @property
        def volts(self):
            """AD5686 channel value in volts"""
            return self.raw * self.scale

        @volts.setter
        def volts(self, val):
            """AD5686 channel value in volts"""
            self.raw = self.to_raw(val)

brunolalb avatar Aug 01 '24 12:08 brunolalb