Created
October 14, 2022 18:01
-
-
Save djhunter67/e71e4bed32e1b0ca91c94adc40c09934 to your computer and use it in GitHub Desktop.
Scale a voltage divided input into an 10-bit ADC on Metro Mini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float scaling_ratio() | |
{ | |
// ADC_REF_VOLTAGE 3.291 | |
double scaler = 7.6666666666666666666; | |
float multiplicative_ratio = scaler; | |
float LSB = (ADC_REF_VOLTAGE / 1024); | |
float scaling_ratio = LSB * multiplicative_ratio; | |
return scaling_ratio; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment