Hello everybody,
i bought a MCUFRIEND 3.5" TFT LCD for Arduino UNO, but i want to use it by Arduino Mega2560 (because i didn't find Arduino Mega shield where i'm living)
i downloaded MUUFRIEND_kbv library and opened showBMP_not_Uno example
as it described in it's comments :
// MCUFRIEND UNO shields have microSD on pins 10, 11, 12, 13
// The official <SD.h> library only works on the hardware SPI pins
// e.g. 11, 12, 13 on a Uno
// e.g. 50, 51, 52 on a Mega2560
// e.g. 74, 75, 76 on a Due
//
// if you are not using a UNO, you must use Software SPI:
//
// install v1.0.1 of the <SdFat.h> library with the Arduino Library Manager.
// edit the src/SdFatConfig.h file to #define ENABLE_SOFTWARE_SPI_CLASS 1
//
// copy all your BMP files to the root directory on the microSD with your PC
// (or another directory)
so i did this editions to be suitable sketch for arduino mega 2560 :
1- edit SPI pins like this :
SdFatSoftSpi<50, 51,52> SD; //Bit-Bang on the Shield pins
#define SD_CS 53
2- remove SdFat.h and install it's v1.0.1 and i opened SdFatConfig.h in it's directory and found the line which wrote #define ENABLE_SOFTWARE_SPI_CLASS 1 and i changed to #define ENABLE_SOFTWARE_SPI_CLASS 0 as the comment said
3-my file name is c.bmp , i copied it (it,s 480*320 pixels) in root directory of microSD Card
my whole edited lines are these lines :
SdFatSoftSpi<50, 51,52> SD; //Bit-Bang on the Shield pins
.....
#define SD_CS 53
#define NAMEMATCH "c" // "" matches any name
//#define NAMEMATCH "tiger" // *tiger*.bmp
#define PALETTEDEPTH 8 // support 256-colour Palette
char namebuf[32] = "/"; //BMP files in root directory
//char namebuf[32] = "/bitmaps/"; //BMP directory e.g. files in /bitmaps/*.bmp
and i didn't edit another lines at all
should i ?
now:
i uploaded it on my Arduino mega 2560 successfully and
i have nothing but blue screen and when i open serial monitor i'll see this at the end :
Show BMP files on TFT with ID:0x9486
cannot start SD
i'll appreciate for some help