david_prentice:
Try Bodmer's TFT_eSPI library.
And I would definitely put all SPI devices onto a single SPI bus. (with transactions)
David.
Thanks, I'll try this library.
BTW, what do you mean? I think it's what I'm doing : both the display and the touch device share MOSI and CLK pins. Is this what you mean?
Pins in the range 34-39 are input only and thus cannot be used as an output for the touch chip select. Try another pin.
The Adafruit library is quite slow but may be sufficient for your needs. If you migrate to the TFT_ESPI you will get a significant (up to x10) performance boost.
The ReadMe file provides quidance:
"Configuration of the library font selections, pins used to interface with the TFT and other features is made by editting the User_Setup.h file in the library folder, or by selecting a configuration in the library "User_Setup_Selet,h" file. Fonts and features can easily be disabled by commenting out lines."
The advantage of this approach is that, once you have edited the setup file, any example will run without modification. There are numerous comments in these setup files that should help.
The "User_Setup_Select.h" file in the library folder is always called up during compilation. Inside that header file is a list of file paths. By default it uses the "User_Setup.h" header but you can edit the paths to callup you own setup or one of the pre-configured ones. Read the comments in these files.