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: mbed Gamepad N5110
Diff: main.cpp
- Revision:
- 1:a3cce487dffe
- Parent:
- 0:0dcf08db8d61
- Child:
- 2:1ad390d81d81
--- a/main.cpp Mon Mar 18 09:34:47 2019 +0000
+++ b/main.cpp Mon Mar 18 11:05:51 2019 +0000
@@ -1,26 +1,42 @@
-#include "mbed.h"
-#include "Gamepad.h"
-#include "N5110.h"
-
-N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
-Gamepad pad;
-
-int main() {
-
- int fps = 8;
-
- pad.init();
- lcd.init();
-
- while(1) {
-
- lcd.clear();
-
- lcd.drawLine(0,40,84,40,1);
-
- lcd.refresh();
-
- wait(1.0f/fps);
-
- }
-}
\ No newline at end of file
+#include "mbed.h"
+#include "Gamepad.h"
+#include "N5110.h"
+#include "Runner.h"
+
+N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
+Gamepad pad;
+Runner runner;
+
+int main() {
+
+ int fps = 8;
+
+ pad.init();
+ lcd.init();
+
+ Move move;
+
+ move = runner.init(move);
+
+ printf("%i %i %i %i", move.j, move.x, move.y, move.f);
+
+ while(1) {
+
+ lcd.clear();
+
+ lcd.drawLine(0,40,84,40,1);
+
+ lcd.drawCircle(move.x,move.y,3,FILL_BLACK);
+
+ printf("%i %i %i %i", move.j, move.x, move.y, move.f);
+
+ move = runner.fallJump(move, lcd);
+
+ lcd.refresh();
+
+ wait(1.0f/fps);
+
+ }
+}
+
+