Yes Alain, go RTFM and come back with another comic ;-)
This has been covered almost as many times as "disable analog functions when using pins as digital" but since it continues to create false statements here we go again.
It's not the word define that's case sensitive, it's what comes after it.
DeFinE ADC_BITS 8 will work, define ADC_BITS 8 will work, Define ADC_BITS 8 (as it was written in the original code) will work and DEFINE ADC_BITS 8 will work. However, DEFINE adc_bits 8 will not because adc_bits is not written in upper case. Or, to state it even more correct, it's not written with the same case as it was originally defined. Had the PBP authours written it as adc_bits then adc_bits would be correct and ADC_BITS would not.
So, again, it's not the word DEFINE that's case sensetive but what comes after it.
My suspicion with the original code is that left/right justification setting was wrong for the 8bit result (I always get that wrong).
/Henrik.




Bookmarks