Chris Dick
/
Gameduino_Rotate_demo
Sprite rotation demo for the Gameduino
Diff: main.cpp
- Revision:
- 0:f67336510583
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Dec 20 22:29:18 2012 +0000 @@ -0,0 +1,27 @@ +#include "mbed.h" +#include "GD.h" +#include "r.h" +#include "shield.h" + +GDClass GD(ARD_MOSI, ARD_MISO, ARD_SCK, ARD_D9, USBTX, USBRX) ; + +int main() +{ + int i; + + GD.begin(); + GD.ascii(); + GD.putstr(0, 0,"Sprite rotation"); + + GD.copy(RAM_SPRIMG, r_img, sizeof(r_img)); + GD.copy(RAM_SPRPAL, r_pal, sizeof(r_pal)); + + for (i = 0; i < 8; i++) { + char msg[] = "ROT=."; + byte y = 3 + 4 * i; + msg[4] = '0' + i; + GD.putstr(18, y, msg); + GD.sprite(i, 200, 8 * y, 0, 0, i); + } +} +