2017-05-10, 09:22 PM
Thanks for the update, the lines setting the config word configure the ADS1115 into single ended and differential, I am not familiar with the control word written to the ads1115. I have just used the Adafruit lib where this hidden behind the scenes. While it's simple to set the control word to the ads 1115 is single ended or differential, one might want to keep a single Ads1115 class in the ads1115.py file.
The choice to use single ended or differential could be selected in the config file. and not as I'm doing make an extra file differential_ads1115.py and an extra box in the GUI. A line in the config file, something like active = N where N is 1 for single ended and 2 for differential, or a bit more intuitive by introducing a new line like differential=0 for single ended and 1 for differential. The the config word could be set as above. Some check should be performed so that each ads1115 only can be put in the mode once, like
[ADS1115_1]
differential=0
[ADS1115_2]
differential=1
or things like
[ADS1115_4]
differential=1 # impossible as there are only two inputs in differential mode.
For the different addresses your proposal is fine, it's quite easy to follow for users. It just need to be documented as users need to know which address they need to set on the ads1115 when deviating from the default. I'm not sure if jumping over a range by going from 0,1,2,3 to 12,13,14,15 if the user set up two ads1115 at 0x48 and 0x4b.
I have used linear regression and supply an offset (added to the value from ads1115) and an intercept and a offset. The adjust_points and adjust cover this as is, the only suggestion is that adjust_points might make polynomial or spline function to interpolate (maybe this a overkill ?).
The choice to use single ended or differential could be selected in the config file. and not as I'm doing make an extra file differential_ads1115.py and an extra box in the GUI. A line in the config file, something like active = N where N is 1 for single ended and 2 for differential, or a bit more intuitive by introducing a new line like differential=0 for single ended and 1 for differential. The the config word could be set as above. Some check should be performed so that each ads1115 only can be put in the mode once, like
[ADS1115_1]
differential=0
[ADS1115_2]
differential=1
or things like
[ADS1115_4]
differential=1 # impossible as there are only two inputs in differential mode.
For the different addresses your proposal is fine, it's quite easy to follow for users. It just need to be documented as users need to know which address they need to set on the ads1115 when deviating from the default. I'm not sure if jumping over a range by going from 0,1,2,3 to 12,13,14,15 if the user set up two ads1115 at 0x48 and 0x4b.
I have used linear regression and supply an offset (added to the value from ads1115) and an intercept and a offset. The adjust_points and adjust cover this as is, the only suggestion is that adjust_points might make polynomial or spline function to interpolate (maybe this a overkill ?).