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
Diff: main.cpp
- Revision:
- 42:ee13e1d103d8
- Parent:
- 41:e1fa36c0492e
--- a/main.cpp Wed May 08 09:22:16 2019 +0000 +++ b/main.cpp Wed May 08 11:18:40 2019 +0000 @@ -8,23 +8,7 @@ Date: 20/02/2019 */ -//______________pre-processor directives________________________________________ -#include "mbed.h" -#include "N5110.h" -#include "RosenEngine.h" -#include "Menu.h" - -//_______________objects________________________________________________________ -N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11); -Gamepad pad; -RosenEngine rosen; -Menu menu; - -//_______________prototypes_____________________________________________________ -void init(); -void welcome(); -void render(); -void ship_select(); +#include "main.h" //_______________functions______________________________________________________ int main() @@ -44,9 +28,9 @@ // printf("get_ycursor() == 16()\n"); while ( pad.check_event(Gamepad::BACK_PRESSED) == false && rosen.dead() == false) { // printf("play...\n"); - rosen.read_input(pad); + rosen.read_input(); // printf("read_input\n"); - rosen.update(pad); + rosen.update(); // printf("update\n"); render(); // printf("render()\n"); @@ -56,8 +40,8 @@ } if(rosen.get_ycursor() == 24) { while ( pad.check_event(Gamepad::BACK_PRESSED) == false) { - rosen.read_input(pad); - rosen.update(pad); + rosen.read_input(); + rosen.update(); ship_select(); wait(1.0f/fps); printf("ship = %d\n",rosen.get_shipno()); @@ -72,7 +56,7 @@ // need to initialise LCD and Gamepad lcd.init(); pad.init(); - rosen.init(9,6,3,42,41); + rosen.init(9,6,3,42,41,&lcd,&pad); printf("Initializing...\n"); } @@ -80,7 +64,7 @@ { // clear screen, re-draw and refresh lcd.clear(); - rosen.draw(lcd, pad); + rosen.draw(); rosen.get_pos(); lcd.refresh(); // printf("Rendering...\n"); @@ -88,7 +72,7 @@ void ship_select() { lcd.clear(); - rosen.ship_select(lcd); + rosen.ship_select(); rosen.get_pos(); lcd.refresh(); printf("Ship Select...\n"); @@ -97,10 +81,15 @@ // simple splash screen displayed on start-up void welcome() { + printf("welcome...\n"); while( pad.check_event(Gamepad::START_PRESSED) == false) { + printf("while lopp...\n"); lcd.clear(); - rosen.title(lcd); - rosen.read_input(pad); + lcd.refresh(); + printf("lcd.clear...\n"); + rosen.title(); + printf("rosen.tittle.\n"); + rosen.read_input(); lcd.refresh(); } printf("Welcome Function completed...\n");