pyadi-iio
pyadi-iio copied to clipboard
AD5686 - get and set channel volts is inconsistent
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)