# Problems with the .h file in libraries or maybe just the ADAFRUIT\_ILI9341 library

**URL:** <https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021>\
**Category:** Libraries\
**Created:** [February 16, 2015, 4:14am UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021 "2015-02-16T04:14:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkSHarrisTX](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/marksharristx/32/4624_2.png) [@MarkSHarrisTX](https://community.particle.io/u/MarkSHarrisTX)\
**Post date:** [February 16, 2015, 4:14am UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/1 "2015-02-16T04:14:33Z")

</div>

Problems with the ADAFRUIT\_ILI9341 0.9.1 library

three files listed:  
ADAFRUIT\_ILI9341.CPP  
ADAFRUIT\_ILI9341.H  
TESTGFX.INO

I select ‘TESTGFX.INO’ and the source code appears in the main window.

I click on “Use this example”

As I expected I get this error message:  
testgfx.cpp:18:43: fatal error: Adafruit\_mfGFX/Adafruit\_mfGFX.h: No such file or directory

I go to the Libraries page and click on ADAFRUIT\_MFGFX 1.0.1 and click on “include in app”. Then click on TESTGFX when it asks “which app”.

Now it lists both:  
ADAFRUIT\_ILI9341  
ADAFRUIT\_MFGFX  
as Included Libraries.

So far so good. However, when I try to compile this, I get and error message of:  
testgfx.cpp:22:30: fatal error: Adafruit\_ILI9341.h: No such file or directory

Can someone tell me what I’m doing wrong or not doing?

I can use the NOKIA-5110-LCD 0.0.7, which also has its own include .h header file in it and I don’t get a problem nor do I have to explictly load that .h file.

Is there something I have to do, to load the header files that are in a library package? I assumed that those automatically got loaded when the library did.

Thanks.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [February 16, 2015, 4:31pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/2 "2015-02-16T16:31:52Z")

</div>

@MarkSHarrisTX, creating IDE libraries can be tricky and rules changed over time. So when @mtnscott created the ili9341 library, the path rules were different. All you have to do is change the path in one line in testgfx.ini (the example). Change line 22:

```
#include "Adafruit_ILI9341.h"

```

to

```
#include "Adafruit_ILI9341/Adafruit_ILI9341.h"

```

It will then compile 😄

---

<div class="post-metadata">

**Author:** ![MarkSHarrisTX](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/marksharristx/32/4624_2.png) [@MarkSHarrisTX](https://community.particle.io/u/MarkSHarrisTX)\
**Post date:** [February 17, 2015, 1:24am UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/3 "2015-02-17T01:24:13Z")

</div>

Wow. Now it compiles. Still not getting displays but I need to make sure my wiring checks with what this program wants.

I’ve spent several weeks banging my head on this, although part of the problem was getting access to this community. I had assumed that if code was in the regular libraries and particularly 30 sometimes, that things like this would have been corrected.

I take it, that since the copies in the Library section must just be copies of what is available in someone’s gethub that they (@mtnscott) have to change it there? That even I, can’t correct it in the library? I can see pros and cons to that.

Thank you very much for the quick and accurate reply.

---

<div class="post-metadata">

**Author:** ![mtnscott](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mtnscott/32/3217_2.png) [@mtnscott](https://community.particle.io/u/mtnscott)\
**Post date:** [February 17, 2015, 5:31pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/4 "2015-02-17T17:31:34Z")

</div>

@MarkSHarrisTX - I updated the include paths to support the latest version of the WebIDE. I apologize for the lost time and confusion. You will find the updated Adafruit\_ILI9341 library example compiles just fine after you include the Adafruit\_mfGFX library. (Sure would be nice to be able to specify additional support libraries to a library)

@peekay123 - Thanks for helping out.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [February 17, 2015, 5:40pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/5 "2015-02-17T17:40:34Z")

</div>

@mtnscott, you rock as usual. I should have posted a PR on your repo 😛

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [February 19, 2015, 1:10am UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/7 "2015-02-19T01:10:44Z")

</div>

@mtnscott, I optimized the library code to run as at DIV2 which produces an SPI clock of 18MHz. If you share your code, I can look at optimizing that. I posted the updated library [here](https://github.com/pkourany/ILI9341_SPI_LCD). 😄

---

<div class="post-metadata">

**Author:** ![mtnscott](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mtnscott/32/3217_2.png) [@mtnscott](https://community.particle.io/u/mtnscott)\
**Post date:** [February 19, 2015, 3:25pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/8 "2015-02-19T15:25:14Z")

</div>

> [@peekay123](#):
>
> DIV2 which produces an SPI clock of 18MHz.

I thought a DIV2 would = 36Mhz, and DIV4 = 18Mhz.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [February 19, 2015, 3:28pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/9 "2015-02-19T15:28:25Z")

</div>

@mtnscott, I did also until I was pointed to the clock tree by @mohit if I remember correctly 😉

---

<div class="post-metadata">

**Author:** ![mtnscott](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mtnscott/32/3217_2.png) [@mtnscott](https://community.particle.io/u/mtnscott)\
**Post date:** [February 19, 2015, 4:29pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/10 "2015-02-19T16:29:36Z")

</div>

@MarkSHarrisTX

@peekay123 did a great job optimizing this library. v0.9.4 is now available in the web IDE. You should see a noticeable improvement in the speed writing to the display.

Enjoy!

---

<div class="post-metadata">

**Author:** ![MarkSHarrisTX](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/marksharristx/32/4624_2.png) [@MarkSHarrisTX](https://community.particle.io/u/MarkSHarrisTX)\
**Post date:** [February 24, 2015, 6:22am UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/11 "2015-02-24T06:22:32Z")

</div>

Thanks. I’ve now got the display running the demo program with all sorts of different displays. Now to start modifying if for my application and adding in all the other inputs.

At least now I’m not flying so blind and I should be able to use the display to show progress and error messages. I still haven’t figured out how to get such messages over the USB port. Such are the trials and tribulations of not having a true system level debugger. Maybe if I can now work and get the Spark-CLI working on my Mac. ☹

---

<div class="post-metadata">

**Author:** ![mtnscott](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mtnscott/32/3217_2.png) [@mtnscott](https://community.particle.io/u/mtnscott)\
**Post date:** [February 24, 2015, 1:56pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/12 "2015-02-24T13:56:20Z")

</div>

> [@MarkSHarrisTX](#):
>
> I still haven't figured out how to get such messages over the USB port.

To get your messages out on the serial port (USB) you can use simple `Serial.print("This is a debug message")`

In your `setup()`

```
Serial.begin(9600);
Serial.print("In Setup");

```

Then on the Mac use the `screen` command

```
screen -L /dev/cu.usbmodemfa131 9600

```

To find your specific device (in case the above does not work) look in your /dev folder

```
ls /dev/cu.usb*

```

You need to wait for your Spark core to completely boot (breathing cyan) before you type the `screen` command. Also after you reset your core (or it crashes) your terminal console will be in a strange state, just type `reset` and it will be restored to normal.

Good Luck

---

<div class="post-metadata">

**Author:** ![dustpuppy](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dustpuppy/32/7406_2.png) [@dustpuppy](https://community.particle.io/u/dustpuppy)\
**Post date:** [October 23, 2015, 12:21pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/13 "2015-10-23T12:21:14Z")

</div>

@peekay123 if I want to include the same library in several different projects, how should I go about it ? Do I have to duplicate the library header and cpp files ?

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [October 23, 2015, 12:25pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/14 "2015-10-23T12:25:17Z")

</div>

@dustpuppy, how are you compiling - web IDE, CLI, DEV or locally?

---

<div class="post-metadata">

**Author:** ![dustpuppy](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dustpuppy/32/7406_2.png) [@dustpuppy](https://community.particle.io/u/dustpuppy)\
**Post date:** [October 23, 2015, 3:58pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/15 "2015-10-23T15:58:38Z")

</div>

@peekay123 I am developing in Particle Dev. I need to check my files into git. It took me some time to understand that one directory can only have one “main script” (with setup() and loop()). I will probably have 3 “main” scripts, and will be using community libraries. It seems silly to have to duplicate the libraries, and I’m hoping to develop shared libraries between my projects.

---

<div class="post-metadata">

**Author:** ![dustpuppy](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dustpuppy/32/7406_2.png) [@dustpuppy](https://community.particle.io/u/dustpuppy)\
**Post date:** [October 23, 2015, 4:09pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/16 "2015-10-23T16:09:07Z")

</div>

@peekay123 sorry I didn’t fully answer. I am developing in Particle Dev, and using the “Compile in cloud and upload using cloud” button. Should I invest time in learning how to compile with the CLI or locally ?

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [October 23, 2015, 4:13pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/17 "2015-10-23T16:13:02Z")

</div>

@dustpuppy, I hear you! For now, you need to have three unique directories with duplicate library files. The long game that the Particle Team is working on will allow for a library repository like arduino. I use CLI because it adds a lot of extras that DEV hasn’t got (yet) like doing a publish or setting up a webhook. Compiling with CLI is super simple so DO check it out for yourself! 😄

---

<div class="post-metadata">

**Author:** ![dustpuppy](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dustpuppy/32/7406_2.png) [@dustpuppy](https://community.particle.io/u/dustpuppy)\
**Post date:** [October 23, 2015, 4:41pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/18 "2015-10-23T16:41:14Z")

</div>

@peekay123 understood, thanks. I can live with that for the time being, I might look into setting up symlinks or something similar.

---

<div class="post-metadata">

**Author:** ![laf0138](https://avatars.discourse-cdn.com/v4/letter/l/c0e974/32.png) [@laf0138](https://community.particle.io/u/laf0138)\
**Post date:** [December 7, 2015, 9:50pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/19 "2015-12-07T21:50:16Z")

</div>

Why are the basics so hard??

I’ve been having troubles with a simple weather sensor, so I started a new test.ino to step through it one at a time. I added two simple libraries and it still has problems. Why can’t the Particle system be more reliable? Need a Library, Add the Library, Verify and it works. Nope.

I simply added these two lines:

```cpp
#include "blynk/blynk.h"
#include "Adafruit_BMP085/Adafruit_BMP085.h"

```

I verified and it kicked out this?

```nohighlight
    In file included from blynk/BlynkParticle.h:16:0,
                 from blynk/BlynkSimpleParticle.h:14,
                 from blynk/blynk.h:2,
                 from test_libraries.cpp:1:
blynk/BlynkApiParticle.h:78:6: warning: #warning "analogInputToDigitalPin not defined => Named analog pins will not work" [-Wcpp]
     #warning "analogInputToDigitalPin not defined => Named analog pins will not work"
      ^
test_libraries.cpp:2:45: fatal error: Adafruit_BMP085/Adafruit_BMP085.h: No such file or directory
 #include "application.h"
                                             ^

compilation terminated.
make[1]: *** [../build/target/user/platform-6test_libraries.o] Error 1
make: *** [user] Error 2

```

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [December 7, 2015, 10:08pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/20 "2015-12-07T22:08:45Z")

</div>

If you want to add a library, it’s not enough to add the `#include` you’d need to import the library via the library tab of Particle Build (aka Web IDE)

If you use the tools right they do work reliable.

---

<div class="post-metadata">

**Author:** ![laf0138](https://avatars.discourse-cdn.com/v4/letter/l/c0e974/32.png) [@laf0138](https://community.particle.io/u/laf0138)\
**Post date:** [December 7, 2015, 11:14pm UTC](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021/21 "2015-12-07T23:14:21Z")

</div>

That was not helpful.

Is it your goal to make condescending comments to people trying to learn, who don’t share your advanced learning degree specific to a topic on Community Forums? I followed the instruction on Particle:

“You can include a library in an application by opening the library drawer, finding a library that will work for your project, and _clicking the “include in app” button_. This will add an #include statement to your code that will expose all the capabilities of the library to your code.”

[Next page](https://community.particle.io/t/problems-with-the-h-file-in-libraries-or-maybe-just-the-adafruit-ili9341-library/10021.md?page=2)
