Ryu Kaz
/
767zi
t6est
lim.md
- Committer:
- kazuryu
- Date:
- 2019-10-05
- Revision:
- 4:9ba47e5db1e2
- Parent:
- 1:bbf776e6c792
File content as of revision 4:9ba47e5db1e2:
#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 } }