Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE LSM9DS1_Library SDFileSystem mbed-rtos mbed wave_player
Diff: main.cpp
- Revision:
- 2:623f29bad35c
- Parent:
- 0:6a49493943be
- Child:
- 3:27889fffc2f7
--- a/main.cpp Thu Mar 10 20:10:35 2016 +0000 +++ b/main.cpp Thu Mar 10 22:51:12 2016 +0000 @@ -1,7 +1,7 @@ #include "mbed.h" #include "InputHandler.h" -//#include "Invader.h" -//#include "Player.h" +#include "Invader.h" +#include "Player.h" #define WIDTH 128 #define HEIGHT 128 @@ -9,10 +9,11 @@ //DigitalOut led(LED1); InputHandler input(p9, p10, 0xD6, 0x3C, p15); -//uLCD_4DGL uLCD(p28,p27,p30); // serial tx, serial rx, reset pin; + +uLCD_4DGL uLCD(p28,p27,p30); // serial tx, serial rx, reset pin; //Player player(&uLCD, &input, WIDTH/2, HEIGHT/2); -//Invader invader(&uLCD, WIDTH/2, HEIGHT/2, 0, 2); +Invader invader(&uLCD, WIDTH/2, HEIGHT/2, 0, 2); void gameLoop(void const *p) { @@ -36,10 +37,10 @@ } int main() { -// Thread gameThread(gameLoop); - printf("Hello World"); -// uLCD.background_color(BLACK); -// invader.draw(); + Thread* gameThread = new Thread(gameLoop); + Thread* inputThread = input.start(); + uLCD.background_color(BLACK); + invader.draw(); while(1) { printf("xAccel: %.6f\n\ryAccel: %.6f\n\rbutton: %s\n\r", input.getXAccel(), input.getYAccel(), input.getPushed() ? "true" : "false");