Screen shot demo and test program for the Gameduino

Dependencies:   Gameduino mbed

Revision:
0:e506a4bb403e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Dec 21 14:03:54 2012 +0000
@@ -0,0 +1,53 @@
+#include "mbed.h"
+#include "GD.h"
+#include "arduino.h"
+#include "shield.h"
+
+GDClass GD(ARD_MOSI, ARD_MISO, ARD_SCK, ARD_D9, USBTX, USBRX) ;
+
+#define RED RGB(255,0,0)
+#define GREEN RGB(0,255,0)
+
+void setup()
+{
+  int i;
+
+  GD.begin();
+  GD.ascii();
+  GD.putstr(20, 0, "Screenshot");
+
+  GD.wr16(RAM_PAL + (8 * 127), RED);   // char 127: 0=red, 3=green
+  GD.wr16(RAM_PAL + (8 * 127) + 6, GREEN);
+  static PROGMEM prog_uchar box[] = {
+     0xff, 0xff,
+     0xc0, 0x03,
+     0xc0, 0x03,
+     0xc0, 0x03,
+     0xc0, 0x03,
+     0xc0, 0x03,
+     0xc0, 0x03,
+     0xff, 0xff };
+  GD.copy(RAM_CHR + (16 * 127), box, sizeof(box));
+
+  for (i = 0; i < 64; i++) {
+    GD.wr(64 * i + i, 127);     // diagonal boxes
+
+    char msg[20];
+    sprintf(msg, "Line %d", i);
+    GD.putstr(i + 2, i, msg);
+
+    GD.wr(64 * i + 49, 127);    // boxes on right
+  }
+
+  //Serial.begin(1000000);
+  long started = millis();
+  GD.screenshot(0);
+}
+
+
+int main(){
+
+   timer_start();
+   setup();
+   
+}
\ No newline at end of file