Cap touch screen compiler error, need help.

Status
Not open for further replies.

joey120373

Well-known member
I am using an Adafruit 2.8" tft with capactive touch: www.adafruit.com/products/2090.

I have had no problems getting this display and touch screen to work with the optimized ILI9341_t3.h library,

there are no conflicts at all when using the optimized ILI9341 library and the Adafruit_FT6206.h library.

However, i found this : https://github.com/FrankBoesing/ILI9341_DEMOS, Specifically the ILI9341_fire.h library. Nice little bit of code for the teensy

3.1 and ILI9341 tft screen and it also works great.

The problem i am having is when i try to add the Adafruit_FT2606 library to the scetch, I get this compiler error :



Arduino: 1.6.5 (Windows 7), TD: 1.25-beta2, Board: "Teensy 3.1, Keyboard + Mouse + Joystick, 120 MHz optimized (overclock), US English"


In file included from My_ILI9341_fire009.ino:29:0:
C:\Users\jmcpherson\Documents\Arduino\libraries\Adafruit_FT6206_Library/Adafruit_FT6206.h:26:18: fatal error: Wire.h: No such file or directory
#include <Wire.h>
^
compilation terminated.
Multiple libraries were found for "ILI9341_t3.h"

Used: C:\Users\jxxxxxxx\Documents\Arduino\libraries\ILI9341_t3

Not used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ILI9341_t3

Multiple libraries were found for "Adafruit_FT6206.h"

Used: C:\Users\jxxxxxxx\Documents\Arduino\libraries\Adafruit_FT6206_Library

Not used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Adafruit_FT6206_Library

Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

This is a bit over my head, any help is apriciated
 
You have your own versions of Adafruit_FT6206 and ILI9431_t3, and the IDE/compiler is using the version in your directory, rather than the system version. Unless you have a good reason for having your own version of the libraries, delete both of these and use the system versions. That way you pick up bug fixes directly when you upgrade the teensy software. You should include these libraries when installing new teensy software (or do like I do, and include everything).

Since it is complaining about Wire.h not being found, you need to edit the example, to add the line:

Code:
#include <Wire.h>

In Arduino versions before Arduino 1.6.6, the tool that converts your .ino or .pde file into a .cpp to be fed to the compiler, it would only use the libraries that you included in the main sketch. This meant if you used a library (like Adafruit_FT6206) that uses the Wire library, you would have to include Wire.h in the main sketch. Arduino 1.6.6 is said to have rewritten the whole process, and now if a library includes an include file from another library, it will automatically include the other library without having to edit the main sketch. However, there are some issues with the rewrite, and you might not want to upgrade the base Arduino library to 1.6.6.

If you are using a Teensy specific library that does i2c, it may use i2c_t3 instead of Wire (i2c_t3 is a teensy specific upgrade to the standard Wire library), you would need to include i2c_t3.h instead of Wire.h. If you are using two libraries, one of which uses Wire and the other uses i2c_t3, you will need to modify the library that uses Wire to use i2c_t3 instead.

Since I still use non-Teensy chips, I recently wrote a perl script to re-create the ~/Arduino directory (under Linux, this is where the user defaults go, equivalent to C:\Users\jmcpherson\Documents\Arduino on your system), and if I give it an option, it populates the library directory with my own copy of the libraries (Adafruit_Neopixel, Adafruit_GFX, and Bounce) that are provided with Teensy, but not with the stock Arduino software.
 
Last edited:
Thanks a ton for the detailed response! After looking at it it made perfect sense. I went into My standard libraries folder and removed the duplicate libraries, i also moved the "fire" library to the teensy> hardware > libraries folder, I had to add Wire.h, and it compiles.

I tried using the teensy I2C_t3 library, even modified the adafruit FT6206 library to include it, i must be missing something because it would not compile. but that is a minor issue, time to start working on my GUI.

Thanks again
 
Status
Not open for further replies.
Back
Top