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
main.cpp
- Committer:
- RickYu
- Date:
- 2018-04-30
- Revision:
- 24:14489d259ffb
- Parent:
- 22:c1e1283c6356
- Child:
- 25:1d91ab97d86a
File content as of revision 24:14489d259ffb:
#include "mbed.h"
#include "Gamepad.h"
#include "N5110.h"
#include "rect.h"
#include "boom.h"
#include "bigboom.h"
#include "money.h"
#include "engine.h"
#include "help.h"
DigitalOut gpo(D0);
DigitalOut led(LED_RED);
N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
Gamepad pad;
engine engine;
help help11;
void init();
void welcome();
void render();
int main()
{
init();
do{
engine.start(pad,lcd);
}
while(pad.check_event(Gamepad::START_PRESSED) == false);
while(1){
engine.read_input(pad);
engine.update(pad,lcd);
render();
wait(0.1);
}
}
void init()
{
//initialise LCD and Gamepad
lcd.init();
pad.init();
}
/*
void welcome() {
lcd.printString(" Boom",0,0);
lcd.printString(" Press start",0,2);
lcd.printString(" help",0,4);
//lcd.printString(" Press Start ",0,4);
lcd.refresh();
//LEDs keep flashing until start button is pressed
while ( pad.check_event(Gamepad::START_PRESSED) == false) {
pad.leds_on();
wait(0.1);
pad.leds_off();
wait(0.1);
}
}
*/
void render()
{
// clear screen, re-draw and refresh
lcd.clear();
engine.draw(lcd);
lcd.refresh();
}