NagaokaRoboticsClub_mbedTeam / PS3

Dependents:   PS3_sample Nucleo_NHK_2018_syudo_wheel kourobo kourobo5 ... more

Revision:
1:7bd8296e6908
Parent:
0:fc5f65cdaaa8
Child:
2:f41f9d145429
--- a/PS3.h	Thu Aug 30 06:04:11 2018 +0000
+++ b/PS3.h	Fri Aug 31 02:25:35 2018 +0000
@@ -4,10 +4,12 @@
 #include "mbed.h"
 #include <vector>
 
+#define PS3_TIMEOUT_COUNT 100
 #define PS3_BUFFER_SIZE 22
 #define PS3_HEADER0 'R'
 #define PS3_HEADER1 'B'
 #define PS3_HEADER2 'N'
+
 #define LEFT_X 0
 #define LEFT_Y 1
 #define RIGHT_X 2
@@ -38,15 +40,17 @@
     bool getButton(int n);
     uint8_t getStick(int n);
     uint8_t getTrigger(int n);
-    std::vector<unsigned char> buf;
     // Thread thread;
-
+    bool status;
+    
 private :
     void receiveByte();
     void assemble();
     void assembleLoop();
 
     Ticker assembleTicker;
+    std::vector<unsigned char> buf;
+    int timeout;
 
     bool button[15];
     uint8_t stick[4];