Getting a error message AFDR not declared.

Hi there,

I am building a time domain reflecto-meter using Arduino, whenever I try to run the code in the Arduino software to simulate it using Proteus 8 ,I get an error message as seen the attachments.
I tried to declare it but it was unsuccessful.

I have also attached the source code as well as the schematic.

Your help would be much appreciated.

Arduino code.txt (1.75 KB)

You are using a library called 'lcd'. Where do I find that?

What processor is your code designed for? Some AVR processors don't have an ADFR (A/D Free Running) bit. You would use the ADATE (A/D Auto Trigger Enable) and set the A/D to trigger on a conversion complete (in ADCSRB).