t6est

Dependencies:   Pulse

Revision:
1:bbf776e6c792
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lim.md	Wed Sep 25 03:57:31 2019 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+
+DigitalIn lim_left();
+DigitalIn lim_right();
+
+int l_r = 0;
+int l_l = 0;
+bool finish_lim = false;
+int from_end = 0;
+int lim_color = 0;//0 = blue
+bool lim_flag = false;
+int distance = 0;
+double all = 0;
+l_r = lim_right.read();
+l_l = lim_left.read();
+
+if(!finish_lim){
+    if(l_r && l_l){
+        finish_lim = true;
+        all = 0;
+    }else if(!l_r && l_l){
+        Move2(LROLL,0.1f);
+    }else if(l_r && !l_l){
+        Move2(RROLL,0.1f);
+    }else{
+        Move2(UP,0.1f);
+    }
+}else{
+    //color選択の関数入れる
+    if(!l_r && !l_l && !lim_flag){
+        lim_flag = true;
+        distance = C + from_end
+    }
+}
\ No newline at end of file