martinisonline
Member level 2
Math problem??...16f877a
Hy...
I'm implementing a temperature meter based in the ds1820.
It works great, but now, i 'm trying to do the high resolution mode.
i need to do a math equation that is:
temp = temp_read - 0.25 + (count_per_C - count_remain)/count_per_C
these variables are int. The 'temp' must be float because the division, right?
Can i do a divison of 2 int and return 1 float?
viewing at hyperterminal, the variable 'temp' is always 0...
I am using CCS and 16F877A.
Greats...
Hy...
I'm implementing a temperature meter based in the ds1820.
It works great, but now, i 'm trying to do the high resolution mode.
i need to do a math equation that is:
temp = temp_read - 0.25 + (count_per_C - count_remain)/count_per_C
these variables are int. The 'temp' must be float because the division, right?
Can i do a divison of 2 int and return 1 float?
viewing at hyperterminal, the variable 'temp' is always 0...
I am using CCS and 16F877A.
Greats...