Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Modifying libpololu-avr Libraries

Hello all,

I am trying to modify certain header files inside the libpolou-avr folder. Specifically making my own methods for the QTR Sensors. I made my changes in what I thought were the appropriate header and cpp files. I then went to the command line and used ‘make’. However, when I then try to use my custom methods inside my Atmel Studio project, they do not show up. Could someone please tell me what I am missing or where I went wrong?

Thank you,

Dark Sage

Hello, Dark Sage.

If the make command ran successfully, then you should see newly-generated files with names like libpololu_atmega328p.a in your libpololu-avr directory. I recommend copying those files and the corresponding header files into the AVR GCC toolchain that Atmel Studio uses so that it can see them. If you are using Atmel Studio 7, you should be able to find the toolchain in “C:\Program Files (x86)\Atmel\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr”.

Copying the files manually is fine. Also, the library’s Makefile provides a command called make install that can help. You can run make show_prefix to see where that command would install the files.

–David

Thank you for your reply. Unfortunately I am still not able to get Atmel Studio 7 to recognize the changes I made to the Pololu3pi.cpp, Polololu3pi.h, PololouQTRSensors.cpp, and PololuQTRSensors.h files. I copied the .a files that ‘make’ generated into C:\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\lib and replaced the ones that were there initially. I’m fairly sure I didn’t make mistakes changing the small code I did otherwise ‘make’ should have thrown an error. All I did was create another method called read_grid_line which has the same return type and parameters as read_line. The only difference between the two is that read_grid_line only takes the values of the three middle sensors of the Pololu 3pi robot. Any further help would be greatly appreciated.

Thank you.

You will need to copy the header (.h) files also. Did you copy your modified Pololu3pi.h into “avr\include\pololu\Pololu3pi\Pololu3pi.h” inside the AVR toolchain? Similarly, did you copy your modified PololuQTRSensors.h file into “avr\include\pololu\PololuQTRSensors\PololuQTRSensor.h”?

–David