Chris Dick
/
Gameduino_Snow_demo
White noise demo for the Gameduino
Revision 0:9962f75920b3, committed 2012-12-21
- Comitter:
- TheChrisyd
- Date:
- Fri Dec 21 14:07:00 2012 +0000
- Commit message:
- Working version
Changed in this revision
diff -r 000000000000 -r 9962f75920b3 Gameduino.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Gameduino.lib Fri Dec 21 14:07:00 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/TheChrisyd/code/Gameduino/#84c1ca3e1be0
diff -r 000000000000 -r 9962f75920b3 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Dec 21 14:07:00 2012 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#include "GD.h" +#include "random.h" +#include "shield.h" + +GDClass GD(ARD_MOSI, ARD_MISO, ARD_SCK, ARD_D9, USBTX, USBRX) ; +int main() +{ + GD.begin(); + int i; + for (i = 0; i < 256; i++) { + GD.wr16(RAM_PAL + (4 * i + 0) * 2, RGB(0,0,0)); + GD.wr16(RAM_PAL + (4 * i + 1) * 2, RGB(0x20,0x20,0x20)); + GD.wr16(RAM_PAL + (4 * i + 2) * 2, RGB(0x40,0x40,0x40)); + GD.wr16(RAM_PAL + (4 * i + 3) * 2, RGB(0xff,0xff,0xff)); + } + GD.microcode(random_code, sizeof(random_code)); +} + +void loop() +{ +} \ No newline at end of file
diff -r 000000000000 -r 9962f75920b3 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Dec 21 14:07:00 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/078e4b97a13e \ No newline at end of file
diff -r 000000000000 -r 9962f75920b3 random.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/random.h Fri Dec 21 14:07:00 2012 +0000 @@ -0,0 +1,16 @@ +static PROGMEM prog_uchar random_code[] = { +0x81,0x15, +0x00,0x80, +0xED,0xFF, +0x00,0x66, +0x00,0x60, +0x00,0x6C, +0x81,0x61, +0x23,0x60, +0x03,0x61, +0x00,0x6A, +0xFF,0x9F, +0x03,0x63, +0x82,0x15, +0x0C,0x70, +}; \ No newline at end of file
diff -r 000000000000 -r 9962f75920b3 shield.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/shield.h Fri Dec 21 14:07:00 2012 +0000 @@ -0,0 +1,48 @@ +#define ARD_D0 p27 +#define ARD_D1 p28 +#define ARD_D2 p29 +#define ARD_D3 p21 +#define ARD_D4 p30 +#define ARD_D5 p22 +#define ARD_D6 p23 +#define ARD_D7 p11 +#define ARD_D8 p12 +#define ARD_D9 p24 +#define ARD_D10 p25 +#define ARD_D11 p5 +#define ARD_D12 p6 +#define ARD_D13 p7 + +#define ARD_D14 ARD_A0 +#define ARD_D15 ARD_A1 +#define ARD_D16 ARD_A2 +#define ARD_D17 ARD_A3 +#define ARD_D18 ARD_SDA +#define ARD_D19 ARD_SCL + +#define ARD_A0 p15 +#define ARD_A1 p16 +#define ARD_A2 p17 +#define ARD_A3 p18 +#define ARD_A4 p19 +#define ARD_A5 p20 + +#define ARD_PWM0 ARD_D3 +#define ARD_PWM1 ARD_D5 +#define ARD_PWM2 ARD_D6 +#define ARD_PWM3 ARD_D9 +#define ARD_PWM4 ARD_D10 +#define ARD_PWM5 p26 + +#define ARD_RX ARD_D0 +#define ARD_TX ARD_D1 +#define ARD_SDA p9 +#define ARD_SCL p10 +#define ARD_MOSI p5 +#define ARD_MISO p6 +#define ARD_SCK p7 +/* +DigitalOut shield_d13(ARD_D13); + +AnalogIn shield_a0(ARD_A0); +*/ \ No newline at end of file