The original snake game for the mbedgc

Dependencies:   mbed EthernetNetIf HTTPClient

Fork of SimpleLib_03272011 by J.P. Armstrong

Committer:
jp
Date:
Thu Aug 22 00:28:15 2013 +0000
Revision:
2:da81fd97aa86
Parent:
0:011be8250218
getting it working

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jp 0:011be8250218 1
jp 0:011be8250218 2 #include "mbed.h"
jp 0:011be8250218 3 #include "colors.h"
jp 0:011be8250218 4 #include "timers.h"
jp 0:011be8250218 5 #include "I2CConfig.h"
jp 0:011be8250218 6 #include "WiiClassicControllerReader.h"
jp 0:011be8250218 7
jp 0:011be8250218 8 #define fbW 121//121 is max//129
jp 0:011be8250218 9 #define fbH 121//121
jp 0:011be8250218 10
jp 0:011be8250218 11 DigitalOut vSync(p29);
jp 0:011be8250218 12 DigitalOut hSync(p30);
jp 0:011be8250218 13 DigitalOut soundPin(p18);
jp 0:011be8250218 14
jp 0:011be8250218 15 int soundNote = 4000;
jp 0:011be8250218 16 int soundNoteHalf = 2000;
jp 0:011be8250218 17 unsigned int hsync_count = 0x80000;
jp 0:011be8250218 18 int hsync_count_adder = 1;
jp 0:011be8250218 19 int logic_count = 0;
jp 0:011be8250218 20
jp 0:011be8250218 21 //Serial pc(USBTX, USBRX);
jp 0:011be8250218 22 DigitalOut led1(LED1);
jp 0:011be8250218 23
jp 0:011be8250218 24 WiiClassicControllerReader ctrlrA(I2CPort_A::SDA, I2CPort_A::SCL);
jp 0:011be8250218 25
jp 0:011be8250218 26 void fill(unsigned char);
jp 0:011be8250218 27 void setup();
jp 0:011be8250218 28 void loop();
jp 0:011be8250218 29 void blankFB();
jp 0:011be8250218 30 int getButton(WiiClassicControllerReader* const ctrlr);
jp 0:011be8250218 31 void drawRectangle(int x, int y, int width, int height, unsigned char color);
jp 0:011be8250218 32
jp 0:011be8250218 33 unsigned int frame = 0;
jp 0:011be8250218 34 unsigned char framebuffer[fbH][fbW];