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:
- 0:6a49493943be
- Child:
- 1:61b8141da36e
- Child:
- 2:623f29bad35c
diff -r 000000000000 -r 6a49493943be main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 10 20:10:35 2016 +0000 @@ -0,0 +1,48 @@ +#include "mbed.h" +#include "InputHandler.h" +//#include "Invader.h" +//#include "Player.h" + +#define WIDTH 128 +#define HEIGHT 128 + +//DigitalOut led(LED1); + +InputHandler input(p9, p10, 0xD6, 0x3C, p15); +//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); + +void gameLoop(void const *p) +{ +// bool alive = true; +// while(alive) { +//// player.update(); +// invader.update(); +// +// invader.draw(); +//// player.draw(); +// +// // If there is a collision, we are done +//// if (invader.intersects(player.getX(), player.getY(), player.getWidth(), player.getHeight())) { +//// led = 1; +//// alive = false; +//// } +// +// Thread::wait(32); // 30 FPS +// } + +} + +int main() { +// Thread gameThread(gameLoop); + printf("Hello World"); +// 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"); + + wait(0.5); + } +}