MrDEB
Well-Known Member
Doing an ADC temperature conversion and had an algebra teacher show/solve the correct formula
This formula is correct until I add the subtract 42.51 into the equation.
the total before multiplying by 1.41 is 79.794,Multiply by 1.41 = 112.509. Subtract the 42.51 =69.99 which is the amount I am after. Seems like any thing I try I still end up with 112.07 w/wo the subtraction.
I tried several different things but when it comes to algebra I AM LOST
It was suggested to use integers???WHOLE NUMBERS?? but would it change anything??
the formula I have is temp = 1.41(ADC COUNT) - 42.51
the ADC count is 79.794.
Do it all on a caculator and it works out right
This formula is correct until I add the subtract 42.51 into the equation.
the total before multiplying by 1.41 is 79.794,Multiply by 1.41 = 112.509. Subtract the 42.51 =69.99 which is the amount I am after. Seems like any thing I try I still end up with 112.07 w/wo the subtraction.
I tried several different things but when it comes to algebra I AM LOST
It was suggested to use integers???WHOLE NUMBERS?? but would it change anything??
Code:
Function sensor() As Word
result = (ADC.Read(0)+1) *5000 / 1024*1023/5*1.41-42.51
End Function
the ADC count is 79.794.
Do it all on a caculator and it works out right