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:
- 1:61b8141da36e
- Parent:
- 0:6a49493943be
--- a/main.cpp Thu Mar 10 20:10:35 2016 +0000
+++ b/main.cpp Thu Mar 10 22:28:51 2016 +0000
@@ -9,40 +9,37 @@
//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);
//Player player(&uLCD, &input, WIDTH/2, HEIGHT/2);
-//Invader invader(&uLCD, WIDTH/2, HEIGHT/2, 0, 2);
+//Invader invader(&uLCD, WIDTH/2, HEIGHT, 0, -2);
-void gameLoop(void const *p)
-{
+//void gameLoop(void const* p)
+//{
// bool alive = true;
-// while(alive) {
-//// player.update();
+// while (alive) {
+// player.update();
// invader.update();
//
+// player.draw();
// 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
+// if (invader.intersects(player.getX(), player.getY(), player.getWidth(), player.getHeight())) {
+// led = 1;
+// alive = false;
+// }
+// Thread::wait(40);
// }
+//}
-}
-int main() {
-// Thread gameThread(gameLoop);
- printf("Hello World");
-// uLCD.background_color(BLACK);
-// invader.draw();
+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);
}
}