|
Post by neuroflux on Jul 2, 2015 18:00:44 GMT -8
I have two images on a FAT formatted 4gb sdcard. They are being fed in with the following code:
#include <EEPROM.h>
#include <SPI.h>
#include <GD2.h>
void setup()
{
GD.begin();
//load image 1
GD.BitmapHandle(0);
GD.cmd_loadimage(0, 0);
GD.load("downtown.jpg");
//load image 2
GD.BitmapHandle(1);
GD.cmd_loadimage(-1, 0);
GD.load("diner1.jpg");
}
void loop()
{
GD.Clear();
GD.Begin(BITMAPS);
GD.Vertex2ii(0, 0, 0); //image 1
GD.Vertex2ii(0, 0, 1); //image 2
GD.swap();
} The problem I have is nothing appears on my screen at all. If I only load one image - it's fine, so I'm guessing it's something to do with the GD.cmd_loadimage(-1, 0); line?
Any ideas?
edit: also to note is when running the "viewer" demo code - my images get stuck at about 50% loading each time :/ the SD card is fine and the images are 11kb JPGs and PNGs.
|
|
|
Post by jamesbowman on Jul 3, 2015 10:32:58 GMT -8
Hmm, slightly modified to use the JPEGs from the distributed SD card set www.excamera.com/files/Gameduino2sd.zipand it seems to work fine. Maybe try with a different SD card? #include <EEPROM.h>
#include <SPI.h>
#include <GD2.h>
void setup()
{
GD.begin();
// load image 1
GD.BitmapHandle(0);
GD.cmd_loadimage(0, 0);
GD.load("selfie.jpg");
// load image 2
GD.BitmapHandle(1);
GD.cmd_loadimage(-1, 0);
GD.load("healsky3.jpg");
}
void loop()
{
GD.Clear();
GD.Begin(BITMAPS);
GD.Vertex2ii(0, 0, 0); //image 1
GD.Vertex2ii(0, 0, 1); //image 2
GD.swap();
}
|
|
|
Post by tftlcdcyg on Nov 14, 2015 10:54:31 GMT -8
The result of loading each image its great. selfie/healsky3, works fine sunrise/healsky3, works fine tree/healsky3, works terrible Sketch to load selfie/sunrise/healsky3: #include <SPI.h>
#include <GD2.h>
void setup()
{
GD.begin();
GD.wr(REG_PWM_DUTY, 75);
// load image 1
GD.BitmapHandle(0);
GD.cmd_loadimage(0, 0);
GD.load("selfie.jpg"); // GD.load("tree.jpg");
// load image 2
GD.BitmapHandle(1);
GD.cmd_loadimage(-1, 0);
GD.load("sunrise.jpg");
// load image 3
GD.BitmapHandle(2);
GD.cmd_loadimage(-2, 0);
GD.load("healsky3.jpg");
}
void loop()
{
GD.Clear();
GD.Begin(BITMAPS);
//image 1
GD.Vertex2ii(0, 0, 0);
GD.Vertex2ii(0, 0, 1);
GD.Vertex2ii(0, 0, 2);
GD.swap();
} Loading: tree/sunrise/healsky3: And the question is: What is the correct sequence to load (3-16) images into GRAM? THX in advance for your support.
|
|
|
Post by jamesbowman on Nov 14, 2015 14:26:48 GMT -8
The FT800 has 256Kbytes of video RAM. These examples are overflowing video RAM.
An image - like "tree.jpg" - that is 480x272 uses up almost all of the RAM, so nothing can be loaded at the same time as "tree.jpg"
|
|