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:
- weixitao
- Date:
- 2017-04-26
- Revision:
- 0:1465fd20e75b
- Child:
- 1:83459533ff72
File content as of revision 0:1465fd20e75b:
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Treasure.h"
#include "hole.h"
N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
Gamepad pad;
Treasure treasure;
hole Blackhole;
int main()
{
lcd.init();
pad.init();
lcd.clear();
lcd.normalMode(); // normal colour mode
lcd.setBrightness(0.5); // put LED backlight on 50%
treasure.treasure_place();
Blackhole.hole_place();
while (1) {
if( pad.check_event(Gamepad::START_PRESSED) == true){
treasure.treasure_place();
Blackhole.hole_place();
lcd.clear();
lcd.refresh();
}
Blackhole.hole_show();
treasure.treasure_show();
lcd.drawRect(40,20,3,3,FILL_BLACK); //head
lcd.drawLine(41,23,41,26,1); //right hand
lcd.drawLine(40,26,42,26,1);// body2
lcd.drawLine(40,26,40,29,1);// body1
lcd.drawLine(42,26,42,29,1);// right leg
lcd.drawLine(38,24,42,24,1);//
lcd.drawLine(42,24,43,25,1);// right hand
lcd.drawLine(38,22,38,25,1);
lcd.drawLine(37,22,37,25,1);
lcd.refresh();
}
}