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
main.cpp
- Committer:
- Dogstopper
- Date:
- 2016-03-10
- Revision:
- 1:61b8141da36e
- Parent:
- 0:6a49493943be
File content as of revision 1:61b8141da36e:
#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); //Player player(&uLCD, &input, WIDTH/2, HEIGHT/2); //Invader invader(&uLCD, WIDTH/2, HEIGHT, 0, -2); //void gameLoop(void const* p) //{ // bool alive = true; // while (alive) { // player.update(); // invader.update(); // // player.draw(); // invader.draw(); // // if (invader.intersects(player.getX(), player.getY(), player.getWidth(), player.getHeight())) { // led = 1; // alive = false; // } // Thread::wait(40); // } //} int main() { // led = 0; input.start(); //Thread thread(gameLoop); while(1) { printf("xAccel: %.6f\n\ryAccel: %.6f\n\rbutton: %s\n\r", input.getXAccel(), input.getYAccel(), input.getPushed() ? "true" : "false"); wait(0.5); } }