nerdegutta
Senior Member
Hi.
I got this:
To take an ADC reading from a LM34, and make it Fahrenheit.
To convert it to Celsius I use this:
But this only work above zero degrees Celsius. When it's getting below zero, it overflows or something. How to I calculate the minus degrees?
Temp, Temp_F and Temp_C are all word variables.
- nerdegutta
I got this:
Code:
Temp = ADCval * 4
Temp = ADCval * 8 / 10 + Temp
Temp = ADCval * 8 / 100 + Temp
Temp_F = Temp / 10
To convert it to Celsius I use this:
Code:
Temp_C = Temp_F - 32
Temp_C = Temp_C * 56 / 100
Temp, Temp_F and Temp_C are all word variables.
- nerdegutta