I put my photo sensor characteristics on the previous blog post.
The curve shows that sensor output around 600 does not change with distance to wall. I have believed that this characteristics is caused by the geometry of emitter and detector because the parallel distance of them is relatively long.
When I wrote the answer in the comments, I came up with another possibility.
Schematic of photo sensor response is shown below.
In general, response of photo transistor is slow and it changes with light intensity.
More intensity the received light is, faster the rising speed becomes.
When the sampling timing of A/D is set to B in the figure,
A/D value is not affected by the response time.
On the other hand, sampling is performed at timing A,
A/D value is determined by the response speed.
There is an advantage to sample at timing A, because saturation of current or output of opamp is avoidable owing to its low photo current.
However, the response speed also saturates for very high intensity of light.
This effect may cause the low sensitive curve in my photo sensor.
If this is true, the easiest solution is to change the value of register,
but, anyway, I cannot change it by the rule for Pi:Co in this year.