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

commit by robo pro coding

parent 473095c1
No related branches found
No related tags found
No related merge requests found
......@@ -40,10 +40,19 @@
<field name="name">read_line_sensors</field>
<data>{"id":"!4|dT?1`M`4]w*0P23*;","filename":"lib/line.py"}</data>
<next>
<block type="import_function_noreturn" id="?r5]N,v_e^w/4]vYi}g,">
<mutation parentId="xo$T:J:?9]BOpX(6C*Np" parentFilename="lib/line.py"/>
<field name="name">print_line_info</field>
<data>{"id":"xo$T:J:?9]BOpX(6C*Np","filename":"lib/line.py"}</data>
<block type="controls_if" id="^pS1dfv]6Ja#h~4ew:uw">
<value name="IF0">
<block type="logic_boolean" id="MopX:+1n6kKMIDSYUnes">
<field name="BOOL">FALSE</field>
</block>
</value>
<statement name="DO0">
<block type="import_function_noreturn" id="?r5]N,v_e^w/4]vYi}g,">
<mutation parentId="xo$T:J:?9]BOpX(6C*Np" parentFilename="lib/line.py"/>
<field name="name">print_line_info</field>
<data>{"id":"xo$T:J:?9]BOpX(6C*Np","filename":"lib/line.py"}</data>
</block>
</statement>
<next>
<block type="controls_if" id="=|@=3O|)YL)3oiQO:%HK">
<mutation elseif="1" else="1"/>
......@@ -132,7 +141,7 @@
</value>
<value name="speed_rotate">
<block type="math_number" id="xYweH`]c4}--J.I#]CA}">
<field name="NUM">450</field>
<field name="NUM">500</field>
</block>
</value>
</block>
......@@ -158,7 +167,7 @@
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="([,q3;KDt25p^%ZYwL4r" x="0" y="737">
<block type="procedures_defnoreturn" id="([,q3;KDt25p^%ZYwL4r" x="0" y="780">
<field name="NAME">thread_display_update</field>
<statement name="STACK">
<block type="display_set_button_enabled" id="R+*qC2@{F,.u[/yT_|/o">
......@@ -275,7 +284,7 @@
</block>
</statement>
</block>
<block type="display_on_button_clicked" id="h9NEZ1yTj+pDceca-h/n" x="0" y="1123">
<block type="display_on_button_clicked" id="h9NEZ1yTj+pDceca-h/n" x="0" y="1166">
<field name="instance_name">txt_button_start</field>
<statement name="statement">
<block type="variables_set" id="Z8*_J+Em!H4iE==YSjZ#">
......
......@@ -39,7 +39,8 @@ while True:
calib_line_rotate360()
while True:
read_line_sensors()
print_line_info()
if False:
print_line_info()
if is_white():
TXT_M_M1_encodermotor.set_speed(int(512), Motor.CCW)
TXT_M_M2_encodermotor.set_speed(int(512), Motor.CW)
......@@ -57,6 +58,6 @@ while True:
break
time.sleep(0.010)
else:
success = follow_line_step(512, 450)
success = follow_line_step(512, 500)
......@@ -562,7 +562,7 @@
<field name="direction_0">Motor.CCW</field>
<value name="speed">
<shadow type="motor_number" id="nXG]b0Q3T(XdH]t44j(J">
<field name="MOTOR_NUM">110</field>
<field name="MOTOR_NUM">150</field>
</shadow>
</value>
</block>
......@@ -590,7 +590,7 @@
<field name="direction_0">Motor.CCW</field>
<value name="speed">
<shadow type="motor_number" id="|@bpzGZ*8qr@j1,hb=51">
<field name="MOTOR_NUM">110</field>
<field name="MOTOR_NUM">150</field>
</shadow>
</value>
<next>
......
......@@ -63,10 +63,10 @@ def follow_line_step(speed_fwd, speed_rotate):
elif line < 50:
TXT_M_M1_encodermotor.set_speed(int(speed_rotate), Motor.CCW)
TXT_M_M1_encodermotor.start_sync()
TXT_M_M2_encodermotor.set_speed(int(110), Motor.CCW)
TXT_M_M2_encodermotor.set_speed(int(150), Motor.CCW)
TXT_M_M2_encodermotor.start_sync()
elif line > -50:
TXT_M_M1_encodermotor.set_speed(int(110), Motor.CCW)
TXT_M_M1_encodermotor.set_speed(int(150), Motor.CCW)
TXT_M_M1_encodermotor.start_sync()
TXT_M_M2_encodermotor.set_speed(int(speed_rotate), Motor.CCW)
TXT_M_M2_encodermotor.start_sync()
......
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