test avoid bulled game

Dependencies:   C12832_lcd LCD_fonts mbed mbed-rtos

Revision:
4:0fe59e58def9
Parent:
1:b8a29dc23cf1
Child:
5:651879f4f047
--- a/main.cpp	Fri Dec 02 06:23:48 2016 +0000
+++ b/main.cpp	Fri Dec 02 07:35:34 2016 +0000
@@ -3,21 +3,38 @@
 #include "Arial_9.h"
 #include "Small_7.h"
 #include "graphics.h"
+#include "models.h"
+#include "rtos.h"
+
 
 C12832_LCD lcd;
 
+// down: p12, left: p13, center: p14, up: p15, right: p16
+DigitalIn button(p14);
+
+int jump_flag = 0;
+
+//int main(){
+//    lcd.cls();
+//    lcd.set_font((unsigned char*) Arial_9);
+//    while(1){
+//        lcd.print_bm(bitmPerson,2,32-6);
+//        lcd.copy_to_lcd();
+//        wait(0.5);
+//        lcd.print_bm(bitmPersonB,2,32-6);
+//        lcd.copy_to_lcd();
+//        wait(0.5);
+//    }
+//}
+
 int main(){
-    lcd.cls();
-    lcd.set_font((unsigned char*) Arial_9);
-    //lcd.print_bm(bitmPerson,95,0);  // print chistmas tree
-   // lcd.copy_to_lcd(); 
-    while(1){
-        lcd.print_bm(bitmPerson,2,32-6);
-        lcd.copy_to_lcd();
-        wait(0.5);
-        lcd.print_bm(bitmPersonB,2,32-6);
-        lcd.copy_to_lcd();
-        wait(0.5);
+    Thread receive_th(receive);
+}
+
+void receive(void const *argument){
+    while(true){
+        if(button){
+            jump_flag = 1;
+        }
     }
-    return 0;
 }
\ No newline at end of file