We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In adc.h:
/* 5V inputs go through voltage divider for 3.3V ADC inputs -- not quite 100% */ static constexpr double REFERENCE_VOLTAGE_DIVIDER = (15.0e3 / (15.0e3 + 8.2e3)); static constexpr double INPUT_VOLTAGE_DIVIDER = (15.0e3 / (15.0e3 + 8.2e3)); static constexpr double VOLTAGE_CONVERSION_CORRECTION_FACTOR = 3.3 / (INPUT_VOLTAGE_DIVIDER * 5.0);
farther down:
/** * @brief Read scaled ADC value * @param channel: adc channel to read * @return current measured voltage */ double readValue(int channel, double vRef = -1) { double volts = ((double)readRawValue(channel) / (double)mMaxVal); if (vRef < 0) { updateReference(); return volts * mVref * VOLTAGE_CONVERSION_CORRECTION_FACTOR; } else { return volts * vRef; } }
Not sure what happened but the multiplication by mVref and division by 5.0 are superfluous and introduce a small error.
The text was updated successfully, but these errors were encountered:
whitfijs-jw
Successfully merging a pull request may close this issue.
In adc.h:
farther down:
Not sure what happened but the multiplication by mVref and division by 5.0 are superfluous and introduce a small error.
The text was updated successfully, but these errors were encountered: