ELEC2645 (2016/17) / Mbed 2 deprecated Bomb_WeixiTao_el16wt

Dependencies:   mbed

Revision:
0:1465fd20e75b
Child:
1:83459533ff72
diff -r 000000000000 -r 1465fd20e75b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Apr 26 16:38:33 2017 +0000
@@ -0,0 +1,50 @@
+#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();
+
+
+                
+        
+    }
+}
\ No newline at end of file