Hi, Mihai
the problem is here:
Code:
grade=(5*temp*100)/1024
you declared " Grade " as a byte, and " grade " is obviously > 500 !!! 
so, here, you need to use DIV32 ... as somewhere in the operation you will get an overflow over 65535 ... ( > WORD )
declare
grade VAR WORD
dummy VAR WORD
and try, as a calculation
Code:
dummy = 500*temp
grade = DIV32 1024
Alain
Last edited by Acetronics2; - 26th June 2010 at 19:06.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks