kinect受信用ライブラリ

Revision:
0:cb6fcdae7ecf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/kinectRX.cpp	Tue Aug 28 04:43:00 2018 +0000
@@ -0,0 +1,30 @@
+#include "kinectRX.h"
+KinectRX::KinectRX():
+    fep(FEP_TX,FEP_RX,FEP_NUM)
+{
+}
+
+
+void KinectRX::receive_data(){
+  len = 5;
+  while(true){
+    count ++;
+    temp = fep.read(data,len);
+    if(temp == 0) {
+      count = 0;
+      break;
+    }
+    if(count > 10){
+        count = 0;
+        break;
+    }    
+  }
+}
+
+int KinectRX::get_mode(){
+  return(data[4]);
+}
+
+int KinectRX::get_distance(){
+  return(data[0] * 1000 + data[1] * 100 + data[2] * 10 + data[3]);
+}