White noise demo for the Gameduino

Dependencies:   Gameduino mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "GD.h"
00003 #include "random.h"
00004 #include "shield.h"
00005 
00006 GDClass GD(ARD_MOSI, ARD_MISO, ARD_SCK, ARD_D9, USBTX, USBRX) ;
00007 int main()
00008 {
00009   GD.begin();
00010   int i;
00011   for (i = 0; i < 256; i++) {
00012     GD.wr16(RAM_PAL + (4 * i + 0) * 2, RGB(0,0,0));
00013     GD.wr16(RAM_PAL + (4 * i + 1) * 2, RGB(0x20,0x20,0x20));
00014     GD.wr16(RAM_PAL + (4 * i + 2) * 2, RGB(0x40,0x40,0x40));
00015     GD.wr16(RAM_PAL + (4 * i + 3) * 2, RGB(0xff,0xff,0xff));
00016   }
00017   GD.microcode(random_code, sizeof(random_code));
00018 }
00019 
00020 void loop()
00021 {
00022 }