|
Post by andromeda92 on Aug 6, 2019 6:00:37 GMT -8
Hi,
i use teensy 3.6, esp8266 and TFT FT813 newhavendisplay.
the code jpeg.ino work well but when in an other programer i use SD card, for example SD.begin ... it don' work
the code below not work:
GD.begin(GD_STORAGE);
delay(1000); // initialize serial for debugging Serial.begin(115200); delay(10); // initialize serial for ESP module Serial5.begin(115200); delay(1000); //GD.__end(); Serial.print("Initializing SD card..."); if (!SD2.begin()) { Serial.println("initialization failed!"); return; } Serial.println("initialization done."); //GD.resume(); loadFileToFT813(); .....
void loadFileToFT813() { GD.cmd_loadimage(0, 0); if (!GD.load("tree.jpg")) GD.alert("file not found"); GD.Clear(); GD.Begin(BITMAPS); GD.Vertex2ii(0, 0); GD.swap(); }
i have tested with end and resume and is a same, it not work, but when i don't use
Serial.print("Initializing SD card..."); if (!SD2.begin()) { Serial.println("initialization failed!"); return; } Serial.println("initialization done."); .... it work!
the declaration of SD2 is
#include <SPI.h> #include <GD23ZU.h>
SdFatSdio SD2;
.....
Any idea ?
thanks for your help.
|
|
|
Post by andromeda92 on Aug 8, 2019 6:47:02 GMT -8
resolved, this work.
void loadFileToFT813(String fname) { File file = SD2.open(fname.c_str()); GD.begin(0); if (!file) GD.alert("file not found"); GD.cmd_loadimage(0, 0); GD.loadSdFat(file); GD.Clear(); GD.Begin(BITMAPS); GD.Vertex2ii(0, 0); GD.swap(); }
|
|