mjs513
Senior Member+
@defragster
Probably because of the datum setting being used in the set up:
BL is bottom left. Options available to you are:
You could try using MC_DATUM. Or try not using any but you may have to adjust the y-positions. Oh I also did a modification to the file to shift the plot over by 80 pixels so its not in the middle of the screen. Attached:
View attachment TFT_BUDDHABROT.zip
Fair warning the writing the image to the SD Card is in there which is still a work in progress, so you will get a sd card not initialized on startup you can just comment that out - it still runs though
Right now - it does write 1 image then hangs on following images, tried delay but same same. I put a bunch of prints to see where but then the T4 just kept on resetting. Have a different sd breakout board coming today so will see it that helps. Also, have to figure out color spaces - argh!
EDIT: I just tried writing multiple files to the T3.6 builtin sd card and it did exactly the same thing - wrote one file and then stopped - on now for some debugging of the function
EDIT2: OK found the problem - malloc. :
Just made it a global array - found the issue on the forum
Probably because of the datum setting being used in the set up:
Code:
tft.setTextDatum(BL_DATUM);
Code:
TL_DATUM = Top left
TC_DATUM = Top centre
TR_DATUM = Top right
ML_DATUM = Middle left
MC_DATUM = Middle centre
MR_DATUM = Middle right
BL_DATUM = Bottom left
BC_DATUM = Bottom centre
BR_DATUM = Bottom right
You could try using MC_DATUM. Or try not using any but you may have to adjust the y-positions. Oh I also did a modification to the file to shift the plot over by 80 pixels so its not in the middle of the screen. Attached:
View attachment TFT_BUDDHABROT.zip
Fair warning the writing the image to the SD Card is in there which is still a work in progress, so you will get a sd card not initialized on startup you can just comment that out - it still runs though
Right now - it does write 1 image then hangs on following images, tried delay but same same. I put a bunch of prints to see where but then the T4 just kept on resetting. Have a different sd breakout board coming today so will see it that helps. Also, have to figure out color spaces - argh!
EDIT: I just tried writing multiple files to the T3.6 builtin sd card and it did exactly the same thing - wrote one file and then stopped - on now for some debugging of the function
EDIT2: OK found the problem - malloc. :
Code:
// create image data; heavily modified version via:
// http://stackoverflow.com/a/2654860
//unsigned char *img = NULL; // image data
//if (img) { // if there's already data in the array, clear it
// free(img);
//}
//img = (unsigned char *)malloc(3*imgSize);
Just made it a global array - found the issue on the forum
Last edited: