TFT code works fine in uno but not in mega

i have build the program using TFT libraries on arduino uno but due to memory limitation i have switched to arduino mega. my program consists of a body image when clicked at certain part it displays the name of that part and this code was working fine on uno, but the same code doesn’t display image rest touch is working fine. like if we touch at body part it shows you have clicked this part only problem is body image is not loading, giving error that sd card initialization fail.

i am using Arduino mega, arduino uno and 2.4" TFT Breakout display


i have build the program

But you have not shared the program.

giving error that sd card initialization fail.

So, you think that this problem is caused by the Mega, rather than your program not using the right pins or setting the mode of those pins correctly. Must be nice to be that naive.

i am new to arduino , and pin connection or the softwareSPI might be the solution of this problem but i dnow how to resolve this…ty

i have attached my code below.
also attached a similar pic of my setup…

display-tested02.ino (7.95 KB)

Did you change the SD chip select pin when you moved the shield to the Mega? Why?

i have tried both direct configuration as shown in the image i uploaded and i also tried via the mega hardware SPI pins , and the sketch i uploaded was of hardware SPI configuration but i have tried both . pin 10 as well as pin 53.

the hardware spi used pin 50,51,52,53 for SD-DO,SD-DI,SD-SCK and SD-SS respectively. rest all pin as it is...........

Would I be right in thinking that all the replies to this post are from folk who have NO IDEA what the guy is talking about and just waffle. I have had the same problem for three years! and get the same supercilious answers such as those from PaulIS. He obviously has no answer but needs to build up his posts. So what is the answer in plain English to why and maybe how the sketches for the Mega 2560 don't work with this or any other any other TFT screen.