2015 robotic contest arakawa A / Mbed 2 deprecated PS3_BlueUSB_Bukatsu

Dependencies:   FatFileSystem mbed

Fork of PS3_BlueUSB_Shibutsu by 2015 robotic contest arakawa A

Revision:
3:8733d7b59027
Parent:
2:98fc1e2f13f4
Child:
4:3d912e4eef8e
--- a/TestShell.cpp	Sat Oct 17 06:29:43 2015 +0000
+++ b/TestShell.cpp	Sun Oct 18 02:55:45 2015 +0000
@@ -109,11 +109,13 @@
     int _ready;
     Timeout _timeout;
     int _count;
+    static bool leaveF;
     
 public:
-    HIDBluetooth() : _control(0),_interrupt(0),_devClass(0), _ready(1) {Dev.baud(921600);};
+    HIDBluetooth() : _control(0),_interrupt(0),_devClass(0), _ready(1){
+        Dev.baud(921600);
+    };
     
-
     bool InUse()
     {
         return _control != 0;
@@ -210,6 +212,12 @@
                     Dev.putc(DATA[i]);
                     printf(": %3d " , DATA[i]);
                 }
+                if(((int)DATA[1]&12)==12&&leaveF){
+                    leaveF=false;
+                    t->Ps3Hid_Rumble(10, 255, 10, 10);
+                }
+                else if(!((int)DATA[1]&12)==12)
+                    leaveF=true;
                 wait(0.001);
                 printf("\n");
                 char flag=0;
@@ -439,6 +447,8 @@
     u8 _ledrumble[37] ;   
 };
 
+bool HIDBluetooth::leaveF=true;
+
 
 HCI* gHCI = 0;