Max Houghton
/
MazeGame_el15mh
el15mh 200929957
Diff: main.cpp
- Revision:
- 6:84572bbd9c5c
- Parent:
- 5:55eee1d71c1d
- Child:
- 8:e16bb923afd3
diff -r 55eee1d71c1d -r 84572bbd9c5c main.cpp --- a/main.cpp Fri Apr 07 10:29:30 2017 +0000 +++ b/main.cpp Wed May 03 21:14:23 2017 +0000 @@ -1,25 +1,16 @@ #include "mbed.h" #include "N5110.h" #include "Gamepad.h" +#include "FXOS8700CQ.h" +#include "Animations.h" #include "Menu.h" -#include "Maze.h" -#include "Ball.h" -#include "MazeEngine.h" // CREATE OBJECTS // N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); -MazeEngine engine; +FXOS8700CQ device(I2C_SDA,I2C_SCL); +Animations animate; Gamepad pad; Menu menu; -Maze maze; -Ball ball; - -// STRUCT FOR INPUT // -struct input { - - Direction direction; - float magnitude; -}; // FUNCTION PROTOTYPES // void init(); @@ -29,25 +20,25 @@ init(); // initialise devices printf("Devices initialised \n"); - menu.intro(lcd, pad); + // menu.intro(lcd, pad, animate); while(1) { - menu.main(lcd, pad); - - printf("Start menu \n"); - - // menu.main(lcd, pad); - // maze.drawBox(lcd); - // lcd.drawCircle(15, 15, 3, FILL_BLACK); - // ball.draw(lcd, 20, 20, 10); + // printf("Start menu \n"); + menu.main(lcd, pad, device, animate); + //lcd.clear(); + //menu.animateJoystick(lcd); + // menu.animateGamepad(lcd, pad); + //lcd.refresh(); } } void init() { + menu.init(); lcd.init(); pad.init(); + device.init(); lcd.setBrightness(pad.read_pot()); -} \ No newline at end of file +}