-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getMaxVoltage() does not handle ADS1113 #68
Comments
Thanks for the issue, |
Note
|
@Mark-81 // ADS1x13 has no gain so set default.
// Table 8. Config Register Field Descriptions
void ADS1113::setGain(uint8_t gain)
{
_gain = ADS1X15_PGA_2_048V; // fixed value
} Will push the develop branch in a few minutes. |
@Mark-81
|
@Mark-81 |
@RobTillaart yeah, it seems to work fine now! Thanks for your quick fix! |
Perhaps related to this issue.
ADS1113 has no gain control and the maximum voltage is fixed to ±2.048 V.
Usually, to convert the ADC readings to a voltage you would write:
but
toVoltage()
callsgetMaxVoltage()
and this does not handle the ADC1113:because in the inizialization:
the
ADS_CONF_NOGAIN
would prevent any handling of the gain, falling back to a wrong one (ADS1X15_PGA_6_144V
):To ensure compatibility of the library across all the supported devices, I think it should handle the ADS1113 properly and
getMaxVoltage()
should return 2.048, perhaps forcing the "gain" toADS1X15_PGA_2_048V
.The text was updated successfully, but these errors were encountered: