So today an anolog value of 97.199 would give the current moon phase,
Well I did look at the moon this morning driving in to work and it was a very thin crescent so I imagine the illumination would be close to zero today.
So 97 out of a full 255 doesn't sound right.
You need only take the fractional part of the dif not the whole of it. Plus if that is phase from new the light peaks at half way (50% phase) and then drops down again.
However, I assume you want to make the light the same a the moon contribution at night, when the moon is anything but full it is not up all night.
@PaulS - You need to avoid integer arithmetic on this because the rounding errors would accumulate every orbit period.