Re: Math for A/D conversion
If you have 20498 in a variable (representing 2.0498V) and you want 2.04 divide the value by 100 so that the value becomes 204 then HSEROUT[DEC value/100, ".", DEC2 value //100]
If you want to round off the value (instead of truncating) add 50, then divide by 100.
/Henrik.
Re: Math for A/D conversion
Thanks Henric
The values in the variable are after divide// for remainder with 0 as leading bit remainder = 0498
Re: Math for A/D conversion
Hi,
I'm sorry, is there still a question in there somewhere or did you solve the problem?
/Henrik.
Re: Math for A/D conversion
Henrik: Yes it is still a question The values in the variable are after divide// for remainder with 0 as leading bit remainder = 0498 any time I have a remainder in a calculation of leading bit 0 debug will not read it. for instance if the remainder is 0498 debug reads 498, if I debug dec 4 then it will read all four digits. If I debug dec2 then it reads 98. I hope I made myself clear enough as to understand my delema.
Re: Math for A/D conversion
And the answer is the same as before. Divide by 100 then use DEC2 to display the result.
If the variable contains 498 and you want that to display as 04 after a decimal point divide by 100 (result = 4) use DEC2 to display with a leading 0. And, again as before, if you rather round than truncate add 50, then divide by 100, then use DEC2. HSEROUT[DEC2 (498+50)/100] will display 05.
/Henrik.
Re: Math for A/D conversion
Henrik: The light finally turned on thanks!!