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.
Diff: main.cpp
- Revision:
- 12:9982239b7906
- Parent:
- 11:2cf0d4ce8677
- Child:
- 13:e5a36fbd48ae
--- a/main.cpp Thu Apr 11 21:01:28 2019 +0000 +++ b/main.cpp Thu Apr 11 21:42:03 2019 +0000 @@ -11,6 +11,7 @@ #include "Gamepad.h" #include "mbed.h" #include "N5110.h" +#include "GameEngine.h" //Objects @@ -18,10 +19,12 @@ N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); GameEngine engine; AnalogIn randnoise(PTB0); +FXOS8700CQ accelerometer(I2C_SDA,I2C_SCL); //Methods void startscreen(); int menu(); +void init(); @@ -33,9 +36,9 @@ init(); startscreen(); int choice_selected = menu(); - if(choice_selected == 0){ engine.classic(accelerometer, fps);} - if(choice_selected == 1){ engine.brickbreaker(accelerometer, fps);} - if(choice_selected == 2){ engine.options_menu(fps);} + if(choice_selected == 0){ engine.classic_mode(accelerometer, gamepad, lcd, fps);} + if(choice_selected == 1){ engine.brickbreaker_mode(accelerometer, gamepad, lcd, randnoise, fps);} + if(choice_selected == 2){ engine.options_menu(gamepad, lcd);} }