The first line (now commented out) works on Uno and Mega2560, but unfortunately is far too slow, the second line is very fast (about 6x) but only works on the Uno, on the Mega2560 the screen remains white and flashes to black and back again once every 7 seconds. Pin connections are exactly same for each board:
#define PIN_TFT_CS 10 #define PIN_SDA 11 #define PIN_SCL 13 #define PIN_TFT_RST 8 #define PIN_TFT_DC 9
(no other pins used in the test)
I need to use the Mega2560 for the extra pins, why can't I get the faster connection working - have I missed something or is there a bug in the library.
The Software SPI constructor has an argument for every pin.
The Hardware constructor omits the MOSI and SCK arguments (because it assumes you are using the Hardware MOSI, SCK pins)
The SW SPI constructor can use any set of random GPIO pins.
The HW SPI constructor must use HW MOSI, SCK but the other arguments can be random GPIO pins.
It is always a good idea to start with the SW SPI constructor. It might be slow but it should work on every Arduino.
This verifies that your screen is working.
Then try the HW SPI constructor. Faster but you must use the correct pins.