Skip to content
Snippets Groups Projects
Commit 4010e704 authored by ft-Demo's avatar ft-Demo
Browse files

commit by robo pro coding

parent b28e3936
Branches master
No related tags found
No related merge requests found
......@@ -57,13 +57,48 @@
<block type="controls_if" id="=|@=3O|)YL)3oiQO:%HK">
<mutation elseif="1" else="1"/>
<value name="IF0">
<block type="import_function_return" id="zNKHD:D@2yBLa?tuJGp-">
<mutation parentId="qvOW30^l!U9[0o}9H)#f" parentFilename="lib/line.py"/>
<field name="name">is_endline</field>
<data>{"id":"qvOW30^l!U9[0o}9H)#f","filename":"lib/line.py"}</data>
</block>
</value>
<statement name="DO0">
<block type="encodermotor_set_values" id="`LR/@E5MHa@m,e^zgH%|">
<mutation syncBlocks="1"/>
<field name="instance_name_0">vv6o.D]}g0#Ew7C~xfQ1-7dv9-J9W4.H3uoY}xp[W</field>
<field name="direction_0">Motor.CCW</field>
<field name="instance_name_1">vv6o.D]}g0#Ew7C~xfQ1-[rGZ27?2t_Go?A6:UHM*</field>
<field name="direction_1">Motor.CW</field>
<value name="speed">
<shadow type="motor_number" id="B-HOk*q?^)ZwRluG`+%u">
<field name="MOTOR_NUM">512</field>
</shadow>
</value>
<value name="distance">
<shadow type="math_number" id="C^Rv{K=b|NZg45/J)6n;">
<field name="NUM">161</field>
</shadow>
</value>
<next>
<block type="util_wait_until" id="[gfi-m|`ja},r(c?V6X7">
<value name="value">
<block type="encodermotor_position_read" id="wTKWwwl+r!C[-yN!2z39">
<field name="instance_name">vv6o.D]}g0#Ew7C~xfQ1-7dv9-J9W4.H3uoY}xp[W</field>
</block>
</value>
</block>
</next>
</block>
</statement>
<value name="IF1">
<block type="import_function_return" id="aVVaE+cL3q|rDyviiQLV">
<mutation parentId="RE;I#E!r_ysU(XAFv{c}" parentFilename="lib/line.py"/>
<field name="name">is_white</field>
<data>{"id":"RE;I#E!r_ysU(XAFv{c}","filename":"lib/line.py"}</data>
</block>
</value>
<statement name="DO0">
<statement name="DO1">
<block type="controls_if" id="4]LYz/pXH@O+g7hWfWT%">
<mutation elseif="0" else="1"/>
<value name="IF0">
......@@ -155,41 +190,6 @@
</statement>
</block>
</statement>
<value name="IF1">
<block type="import_function_return" id="zNKHD:D@2yBLa?tuJGp-">
<mutation parentId="qvOW30^l!U9[0o}9H)#f" parentFilename="lib/line.py"/>
<field name="name">is_endline</field>
<data>{"id":"qvOW30^l!U9[0o}9H)#f","filename":"lib/line.py"}</data>
</block>
</value>
<statement name="DO1">
<block type="encodermotor_set_values" id="`LR/@E5MHa@m,e^zgH%|">
<mutation syncBlocks="1"/>
<field name="instance_name_0">vv6o.D]}g0#Ew7C~xfQ1-7dv9-J9W4.H3uoY}xp[W</field>
<field name="direction_0">Motor.CCW</field>
<field name="instance_name_1">vv6o.D]}g0#Ew7C~xfQ1-[rGZ27?2t_Go?A6:UHM*</field>
<field name="direction_1">Motor.CW</field>
<value name="speed">
<shadow type="motor_number" id="B-HOk*q?^)ZwRluG`+%u">
<field name="MOTOR_NUM">512</field>
</shadow>
</value>
<value name="distance">
<shadow type="math_number" id="C^Rv{K=b|NZg45/J)6n;">
<field name="NUM">161</field>
</shadow>
</value>
<next>
<block type="util_wait_until" id="[gfi-m|`ja},r(c?V6X7">
<value name="value">
<block type="encodermotor_position_read" id="wTKWwwl+r!C[-yN!2z39">
<field name="instance_name">vv6o.D]}g0#Ew7C~xfQ1-7dv9-J9W4.H3uoY}xp[W</field>
</block>
</value>
</block>
</next>
</block>
</statement>
<statement name="ELSE">
<block type="variables_set" id="Z*LZnGctJdLP]SZ=^T+m">
<field name="VAR" id="s`)JpS~a2Z(f+qR$zzzs">success</field>
......
......@@ -41,7 +41,15 @@ while True:
read_line_sensors()
if False:
print_line_info()
if is_white():
if is_endline():
TXT_M_M1_encodermotor.set_speed(int(512), Motor.CCW)
TXT_M_M2_encodermotor.set_speed(int(512), Motor.CW)
TXT_M_M1_encodermotor.set_distance(int(161), TXT_M_M2_encodermotor)
while True:
if (not TXT_M_M1_encodermotor.is_running()):
break
time.sleep(0.010)
elif is_white():
if True:
TXT_M_M1_encodermotor.set_speed(int(512), Motor.CCW)
TXT_M_M2_encodermotor.set_speed(int(512), Motor.CW)
......@@ -64,14 +72,6 @@ while True:
if (not TXT_M_M1_encodermotor.is_running()):
break
time.sleep(0.010)
elif is_endline():
TXT_M_M1_encodermotor.set_speed(int(512), Motor.CCW)
TXT_M_M2_encodermotor.set_speed(int(512), Motor.CW)
TXT_M_M1_encodermotor.set_distance(int(161), TXT_M_M2_encodermotor)
while True:
if (not TXT_M_M1_encodermotor.is_running()):
break
time.sleep(0.010)
else:
success = follow_line_step(512, 500)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment