scorrpeio
Full Member level 5

I am facing a problem while converting the received Temperature count into its equivalent temperature.
I have used LM35 as temp sensor and PIC18F4520 as controller.
The logic goes as...
Now, I have declared Temperature as unsigned int. So, the above instruction doesnt serve the purpose.
I have also tried to multiply by 100 and during display divide by 100.
But, since the variable is int, the divide instruction creates an unidentifiable bug. I cant see any output, not even led blinking. 8O
Is it not possible to do above calculation using int only?:idea: Ought I use float?
If I use float how can I convert the hex( 234.546) into its equivalent decimal? :|
I have used LM35 as temp sensor and PIC18F4520 as controller.
The logic goes as...
Code:
Temperature = LM35Value * 0.48;
Now, I have declared Temperature as unsigned int. So, the above instruction doesnt serve the purpose.
I have also tried to multiply by 100 and during display divide by 100.
But, since the variable is int, the divide instruction creates an unidentifiable bug. I cant see any output, not even led blinking. 8O
Is it not possible to do above calculation using int only?:idea: Ought I use float?
If I use float how can I convert the hex( 234.546) into its equivalent decimal? :|