Problems with library Adafruit_ILI9341 (1.0.2)

Hi!,
i’m returning to an old Photon-based project which uses am ILI9341 tft dispay from adafruit, and when i try to compile the graphicstest.ino example included on the library Adafruit_ILI9341 (1.0.2) available from Particle IDE, first the following error appears:

/workspace//src/graphicstest.cpp:124:9: error: 'yield' was not declared in this scope

in case i comment all the yield() sentences on the graphicstest.ino code, the following error appears:

/workspace/lib/Adafruit_ILI9341/src/Adafruit_ILI9341.cpp:45:65: error: 'SPISettings' was not declared in this scope
SPI.beginTransaction(SPISettings(30000000, MSBFIRST, SPI_MODE0));

however, with legacy versions of the libraries, i do’nt have any problem compiling my original codes. does anyone know which are the problems with this library? thanks

@fbt can you try compiling with system firmware 0.6.2 and see if it works?

May also (on top of using 0.6.2) need to add #include "Arduino.h"; at the top of the user app.

1 Like

Hi! @kennethlimcp and @peekay123 … i tried both recommendations and still getting the same error. thanks

I’ll take a look in the evening.

@fbt it seems like it is only working with 0.6.1.
Can you give it a try?

@peekay123 seems like there needs to be some work done for 0.6.2

@kennethlimcp, @fbt, the issue relates to the Arduino compatiblity that was added/changed in version 0.6.1 and 0.6.2 of the firmware. The new Particle firmware supports SPISettings() but the code in the ILI9341 library requires that Arduino.h be included. As for yeild(), it is also defined in the Arduino.h compatibility file. I’ll figure out how to best deal with these items tonight and then repost the library.

2 Likes

Keenly interested! just so happened to pickup a neglected screen and try to run it today!

ps, @peekay123, do you have an amazon wishlist etc? so many times benefited from your after hours code porting, it’d be nice to say thanks!

2 Likes

@mterrill, I still haven’t come up with a solution yet but will post asap when I do. As for the wishlist, let me think about that one.

2 Likes

@mterrill, I’ve fixed the library and the example compiles as it should. The trick is that I wanted to enable SPI_TRANSACTIONS which is in the Arduino functionality. This allows different SPI devices with different speeds, modes, etc. to cohabitate on the SPI bus, as long as all libraries use SPI transactions.

Let me know if everything works ok for you :wink:

4 Likes

Hi @peekay123, now it compiles OK. Once again, thanks a lot for your valuable support.

2 Likes

Thanks for the help!