For my own future reference more than anything else, to get the ILI9341 (either Adafruit or otherwise) working on the ESP8266 using the Arduino development environment isn’t completely straightforward. I knew I had this working previously, but couldn’t find the info again, so am copying it here.
See the details after the break.
It would appear that the ILI9341 library currently available through the Arduino Sketch -> Include Library -> Manage Libraries is not currently compatible with the ESP8266. Thus you have to download the working library directly from the Adafruit Github repository. However, I also had issues with this version. Finally I used the examples on http://nailbuster.com/?page_id=341 to get it working.
Additionally, the XPT2046 library available in the Arduino manage libraries feature does not support Hardware SPI, however there is an alternative developed by [spapadim] on Github. I took the following steps to compile some example code.
- Wire up ESP and Touch screen according to http://nailbuster.com/?page_id=341
- Download the zip file from the end of the page on http://nailbuster.com/?page_id=341 this includes some working examples
- Download XPT2046 library from Github https://github.com/spapadim/XPT2046
- Go to Arduino IDE -> Sketch -> Include Library -> Manage Libraries -> Search GFX and install the “Adadfruit GFX Library”
- Open the example sketch from Nailbuster and compile and upload
I have a feeling these libraries may be a little out of date now so I’ll have a look at whether they can be updated to use the latest versions available from Adafruit.