The */ operator first multiplies the 2 values (Uin * 124).
Then it discards the low byte, and returns the rest.
So effectively, it divides the result by 256, without having to do the divide part.
100 / 207 = 0.48309178
124 / 256 = 0.484375 ; not exact, but pretty close
You're correct that there are small differences between the 2 formulas, but the error is less than +/- 1. And, you will never see a difference with the resolution of a 16 block bargraph.
And, there probably is a need to test it.
I was using a 16F877 with a 4x20 LCD. Could have missed something for your 16F628A and 1x16 LCD.
<br>




Bookmarks