Programming: Converting the ADC Result to a Number that Represents a Unit of Measurement (Inches of Mercury)

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);
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.