I am trying to get the sample code to compile in arduino but keep getting this error.
Arduino: 1.6.5 (Windows 8.1), Board: “Arduino Uno”
C:\Users\Allen\Documents\Arduino\libraries\zumo_32u4_arduino_library_master\L3G.cpp:2:18: fatal error: Wire.h: No such file or directory
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
I am new to the QTR and I don’t understand why it is using the Zumo library. I am trying to load it onto a uno. The file does exhist and so does L3G.cpp and the #include <wire.h> I am totally confused . What have I done wrong?
It sounds like you are trying to compile some example code from our Arduino Library for the Pololu QTR Reflectance Sensors but the Arduino IDE is using our Zumo32U4 library (which contains a copy of the QTRSensors library) instead of using the main QTRSensors library. Please make sure that the QTRSensors library is in the folder “C:\Users\Allen\Documents\Arduino\libraries\QTRSensors”. In particular, the main header file should be “C:\Users\Allen\Documents\Arduino\libraries\QTRSensors\QTRSensors.h”. When you try to compile a sketch with the line
#include <QTRSensors.h>, the Arduino IDE will looks for all the libraries that contain a file with that name, and it will find both the Zumo32U4 library and the QTRSensors library. To ensure that the Arduino IDE selects the right library, the QTRSensors library should be installed in a folder with the right name.
If you continue to have trouble, please post some screenshots from your “libraries” folder so that I can verify that your files are installed correctly.
Thanks David, I copied the QTRSensors.h and the.cpp file from the QTRSensors\samples and pasted them in the QTRSensor directory and then it compiled. It did find them in the zumo folder but did not use them. Your help is greatly appreciated.
I am not sure where you found a “QTRSensors\samples” folder, but it sounds like you got things working. If you have trouble again then I recommend deleting your copy of the QTRSensors library and then carefully following the instructions in the following document to download and install the QTRSensors library:
There should be no need to copy or move individual files.