Programming: Converting the ADC Result to a Number that Represents a Unit of Measurement (Inches of Mercury)
Share
The formula that converts the ADC value to inches of Hg (using the slope intercept formula): inches of HG = -0.0377(ADC_Value) + 35.5134
The portion of the program that pertains to the conversion: uint8_t theLowADC = ADCL; uint16_t TenBitResult = ADCH<<8 | theLowADC; InchesOfHg = -0.0376 * TenBitResult + 35.532; Send_An_IntegerToMrLCD(15, 1, InchesOfHg, 4);