3pi Wall Follower Issues

The program supplied with the 3p1 wall follower (3pi_wall_follower.pdf) will not compile on te AVR and returns many errors related to general commands. Other example programs compile and run fine. I also cannot find the “avr/pgmspace.h” file or a link where to download this library file.


It sounds like you just don’t have your project configured properly to link in the Pololu AVR library file. If you made your AVR Studio project from scratch, please make sure you have followed the steps in section 7 of the library user’s guide. The file “avr/pgmspace.h” is part of WinAVR and should already be in the proper place if you have WinAVR installed.

- Ben

It did turn out to be configurations. First was trying to use version 4.19 AVR Studio, had to go to version 4.18 (in the bundle).
I also needed to specify the right processor, 328p.

The code builds fine but does not work as described. I noticed the second sensor on ADC6 is never initialized or used?

I am a novice but it seems like this code never uses the second sensor?

Is there any OTHER code available for using TWO sensors on PC5 and ADC6?
I only have skills for modifying, not writing code from scratch.

The sample code you are using assumes the sensors are connected to PC5 and ADC7 (see the “Construction” section). If you want to connect your sensor to ADC6 instead of ADC7, you need to change the following line in the program from:

int proximity = analog_read(7); // 0 (far away) - 650 (close)


int proximity = analog_read(6); // 0 (far away) - 650 (close)

However, I think the easiest thing for you to do is to actually build the robot as described in the guide (i.e. use PC5 and ADC7) and first get something working, and then start looking into modifying it.

- Ben