Please Help me.
how to use this schematic for apllied in ATmega16, i use CodeVisionAVR. Please Explain step by step to config ADC. Thanks before..
**broken link removed**
To detect which key is pressed, the code checks the ADC result (i) in which interval it is, based on the last column (Binary out, see fig.). But the latter depends on Vcc, the upper limit (sometimes the lower limit as well) of the ADC range. When the 3rd column can be calculated then your subroutine above can be adjusted rather easily, I mean find the values in it.
Codevision has a wizard so open a new project , go to the ADC tab and set the ADC parameters.
Select AVCC as voltage reference, the clock should be below 200k, use free running mode and if you want to get an interrupt where the conversion ends then enable the interrupt checkbox.