Announcement

Collapse
No announcement yet.

uOLED-128-G2 Video Issues

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • uOLED-128-G2 Video Issues

    I have an Arduino Mega 2560 hooked up to the uOLED-128-G2. I have loaded a few animated GIF files onto a 2GB Sandisk uSD card. The baud rate is the default 9600.

    When I connect using the Serial Commander, I can access and play each of the files with no problem.

    When I run a program on the Arduino Mega, it will work fine and display text but only the GIF video file at location 0. When I


    Here are the file data:

    Code:
    // Movie - "Moonanime01.gif" Size 128x128// Width  = 128// Height = 128// Frames = 39// Usage: Moonanime01.gif(x, y);#constant Moonanime01.gif    $media_SetSector(0x0000, 0x0000); media_Video // Movie - "Moonanime02.gif" Size 128x128// Width  = 128// Height = 128// Frames = 39// Usage: Moonanime02.gif(x, y);#constant Moonanime02.gif    $media_SetSector(0x0000, 0x09C1); media_Video // Movie - "Moonanime12.gif" Size 128x128// Width  = 128// Height = 128// Frames = 39// Usage: Moonanime12.gif(x, y);#constant Moonanime12.gif    $media_SetSector(0x0000, 0x1382); media_Video // Movie - "Static1.gif" Size 128x128// Width  = 128// Height = 128// Frames = 10// Usage: Static1.gif(x, y);#constant Static1.gif    $media_SetSector(0x0000, 0x1D43); media_Video // Movie - "Static2.gif" Size 128x128// Width  = 128// Height = 128// Frames = 3// Usage: Static2.gif(x, y);#constant Static2.gif    $media_SetSector(0x0000, 0x1FC4); media_Video // Movie - "Static5.gif" Size 128x128// Width  = 128// Height = 128// Frames = 14// Usage: Static5.gif(x, y);#constant Static5.gif    $media_SetSector(0x0000, 0x2085); media_Video

    I have used bits of the BigDemo code:

    Code:
    #define DisplaySerial Serial1 #include <Goldelox_Const4D.h>#include <Goldelox_Const4DSerial.h>#include <Goldelox_Serial_4DLib.h> Goldelox_Serial_4DLib Display(&amp;DisplaySerial);  const int ResPin = 7;int fmediatests;  int trymount(void){#define retries 15  int i ;  int j ;  i = Display.media_Init() ;  j = 0 ;  if (!i)  {    Display.putstr("Pls insert uSD crd\n") ;    while (   (!i)          &amp;&amp; (j < retries) )    {      Display.putstr(".") ;      i = Display.media_Init() ;      j++ ;    }    Display.putstr("\n") ;  }  if (j == retries)    return FALSE ;  else    return TRUE ;}   void Media_Tests(void){   Display.putstr("Test String 1\n\n");  delay(1000);  Display.putstr("Test String 2\n\n");  delay(1000);  Display.putstr("Test String 3\n");  delay(1000);  Display.gfx_Cls();   Display.media_SetAdd(0,0) ;     // using addresses from .dat file  Display.media_Video(0,0) ;  delay(1000);  Display.gfx_Cls();  delay(1000); // delay(1000) ;}    void setup(){ pinMode(ResPin, OUTPUT);digitalWrite(ResPin, LOW); // Reset the Display via D7delay(100);digitalWrite(ResPin, HIGH); // unReset the Display via D7  Serial1.begin(9600); delay(3500); Display.gfx_Cls() ; Display.TimeLimit4D = 5000; Display.Callback4D = NULL;  } void loop(){  fmediatests = trymount();  if (fmediatests != 0) {    Media_Tests() ;} }
    The code above works fine. But when I change:

    Display.media_SetAdd(0,0) ; // using addresses from .dat file

    to

    Display.media_SetAdd(0,0x09C1) ; // using addresses from .dat file

    to play the second file, it does not show the video. It just shows the text lines. The same thing happens when I put in the addresses for the other videos. However, when it is run through Serial Commander with these same addresses, they all show up properly.

    I'm hoping someone will spot an obvious error on my part.

    Thanks.



  • #2


    media_SetSector(0x0000, 0x09C1);

    and

    Display.media_SetAdd(0,0x09C1) ; // using addresses from .dat file

    Are totally different, try

    Display.media_SetSector(0,0x09C1) ; // using addresses from .dat file
    Mark

    Comment


    • #3


      I new it had to be something obvious.

      Thanks, it works!

      Comment

      Working...
      X