I am trying to display image on uOLED128G2 from micro sd card. I built usd raw data of one 128*128 jpg file with graphic composer and run the following Arduino sketch on Arduino Due, but I only see the text "Media Tests" on display (so I am sure the connection between Arduino and display is good), not image.
When I transfer the data to usd, I added a bitmap file to graphic composer, and built it with "4DGL -uSD Raw" build type and zero offset (see attached screen shots).

After building, It produced the following gc file and text file.
gc file
text file
Could you give me an advice why I can't see any image on the display?
Thanks,
Code:
#define DisplaySerial Serial1 #define LOG_MESSAGES #ifdef LOG_MESSAGES #define HWLOGGING Serial #else #define HWLOGGING if (1) {} else Serial #endif #include "Goldelox_Serial_4DLib.h" #include "GoldeloxBigDemo.h" #include "Goldelox_Const4D.h" Goldelox_Serial_4DLib Display(&DisplaySerial); // globals for this program int fmediatests ; void Callback(int ErrCode, unsigned char ErrByte) { #ifdef LOG_MESSAGES const char *Error4DText[] = {"OK\0", "Timeout\0", "NAK\0", "Length\0", "Invalid\0"} ; HWLOGGING.print(F("Serial 4D Library reports error ")) ; HWLOGGING.print(Error4DText[ErrCode]) ; if (ErrCode == Err4D_NAK) { HWLOGGING.print(F(" returned data= ")) ; HWLOGGING.println(ErrByte) ; } else HWLOGGING.println(F("")) ; while (1) ; // you can return here, or you can loop #endif } #define RESETLINE 4 void setup() { pinMode(RESETLINE, OUTPUT); // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset) digitalWrite(RESETLINE, 1); // Reset the Display via D4 delay(100); digitalWrite(RESETLINE, 0); // unReset the Display via D4 delay(5000); #ifdef LOG_MESSAGES HWLOGGING.begin(19200); while (!HWLOGGING) continue; HWLOGGING.print(F("\n\nBigDemo for Arduino\n")); #endif } void loop() { Display.TimeLimit4D = 5000; Display.Callback4D = Callback; DisplaySerial.begin(9600) ; Display.gfx_Cls() ; fmediatests = Display.media_Init(); if (fmediatests) HWLOGGING.println(F("Media tests will be done")) ; else HWLOGGING.println(F("Media tests cannot be done, missing uSD card")) ; delay(2000) ; if (fmediatests) { Display.gfx_Cls() ; Display.putstr("Media Tests") ; Display.media_Image(0, 0); delay(10000); } }
When I transfer the data to usd, I added a bitmap file to graphic composer, and built it with "4DGL -uSD Raw" build type and zero offset (see attached screen shots).
After building, It produced the following gc file and text file.
gc file
Code:
// Image - "test.bmp" Size 128x128 // Width = 128 // Height = 128 // Usage: test.bmp(x, y); #constant test.bmp $media_SetSector(0x0000, 0x0000); media_Image
Code:
"test.bmp" 0000 0000 00 00
Thanks,
Comment