White noise demo for the Gameduino

Dependencies:   Gameduino mbed

Committer:
TheChrisyd
Date:
Fri Dec 21 14:07:00 2012 +0000
Revision:
0:9962f75920b3
Working version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
TheChrisyd 0:9962f75920b3 1 #include "mbed.h"
TheChrisyd 0:9962f75920b3 2 #include "GD.h"
TheChrisyd 0:9962f75920b3 3 #include "random.h"
TheChrisyd 0:9962f75920b3 4 #include "shield.h"
TheChrisyd 0:9962f75920b3 5
TheChrisyd 0:9962f75920b3 6 GDClass GD(ARD_MOSI, ARD_MISO, ARD_SCK, ARD_D9, USBTX, USBRX) ;
TheChrisyd 0:9962f75920b3 7 int main()
TheChrisyd 0:9962f75920b3 8 {
TheChrisyd 0:9962f75920b3 9 GD.begin();
TheChrisyd 0:9962f75920b3 10 int i;
TheChrisyd 0:9962f75920b3 11 for (i = 0; i < 256; i++) {
TheChrisyd 0:9962f75920b3 12 GD.wr16(RAM_PAL + (4 * i + 0) * 2, RGB(0,0,0));
TheChrisyd 0:9962f75920b3 13 GD.wr16(RAM_PAL + (4 * i + 1) * 2, RGB(0x20,0x20,0x20));
TheChrisyd 0:9962f75920b3 14 GD.wr16(RAM_PAL + (4 * i + 2) * 2, RGB(0x40,0x40,0x40));
TheChrisyd 0:9962f75920b3 15 GD.wr16(RAM_PAL + (4 * i + 3) * 2, RGB(0xff,0xff,0xff));
TheChrisyd 0:9962f75920b3 16 }
TheChrisyd 0:9962f75920b3 17 GD.microcode(random_code, sizeof(random_code));
TheChrisyd 0:9962f75920b3 18 }
TheChrisyd 0:9962f75920b3 19
TheChrisyd 0:9962f75920b3 20 void loop()
TheChrisyd 0:9962f75920b3 21 {
TheChrisyd 0:9962f75920b3 22 }