theog
Junior Member
Posts: 13
|
Post by theog on Sept 26, 2015 10:14:39 GMT -8
Hello, I wanted to use an external SD Card unit with the GD2. I read your Thread about how to use an external reader, where somebody mentioned the GD.__end(); and GD.resume(); functions but I need help:
How can I load a picture from the SD card and view it on the GD2? I tried nearly everything but it does´t work. Please help me.
Thank you
|
|
|
Post by jamesbowman on Sept 26, 2015 19:05:41 GMT -8
Did you try the 'viewer' sample, under "4.Utilities"? If so, what happens?
|
|
theog
Junior Member
Posts: 13
|
Post by theog on Sept 26, 2015 23:44:45 GMT -8
Nothing, it stays black. How should the sample work with an external SD card reader?
|
|
|
Post by jamesbowman on Sept 27, 2015 9:57:44 GMT -8
Not sure what you are asking.. do you mean (a) the SD slot built into the GD2? Or (b) some other third-party SD reader. If (a), then yes it should work out of the box. Run the "selftest" tool and it should say what is failing. If (b) then this thread should help: gameduino2.proboards.com/thread/71/using-sd-card-data-storage
|
|
theog
Junior Member
Posts: 13
|
Post by theog on Sept 27, 2015 11:16:21 GMT -8
I mean (b), I read that thread carefully but it didn't help.
I use a third party sd card reader. But I can't figre out how to load a picture from the sd card (stoped GD) and then load it on the GD (GD running again) How does this work?
Thank you a lot.
|
|
theog
Junior Member
Posts: 13
|
Post by theog on Sept 29, 2015 2:15:27 GMT -8
I basically didn´t know how i can load the BITMAP from the SD Card. How can I store a Bitmap which is loaded from a SD Card (in the void setup) in a Variable to then drop it with Vertexii (in the void loop)? Is there a Bitmap datatype to store a Picture?
This is my Idea but it does´t work. This only work with the internal SD Card. How can I read the pic from an third party SD Card reader?
#include <SPI.h> #include <SD.h> #include <GD2.h> #include <EEPROM.h>
const int chipSelect = 14;
void setup() { Serial.begin(9600); pinMode(SS, OUTPUT);
GD.begin(~GD_STORAGE);
// load image 1
GD.BitmapHandle(0);
GD.cmd_loadimage(0, 0);
GD.load("Homescreen1pressed.jpg"); }
void loop(void) { GD.Clear(); GD.Begin(BITMAPS); GD.Vertex2ii(0, 0, 0); //image 1 GD.swap(); }
|
|