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.
@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:
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.
@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)
@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.
@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.
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.
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.
@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 ?
@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.
@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 ?
@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!
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.
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
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.”