Hi,
We want a "raw" display value of 5060 when the ADC returns 3272. That's a factor of 1.5464, right?
The ** operator does a 16*16bit multiplication and then returns the 16 top bits of the intermediate 32bit result which is the same as dividing that intermediate result by 65536.
So, on a calculator, 3272 * 35809 / 65536 = 1787 (truncated). Add in the "original" 3272 and we get 5059 which is pretty close to 5060.
Just think of the ** operators as multiplying by units of 1/65536.
65536*0.5464 = 35809...
35809 * (1/65536) = 0.5464...
And so on.
/Henrik.
Bookmarks