Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RoboMission_line_demo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fischertechnik examples
STEM Coding RoboMission
RoboMission_line_demo
Commits
b28e3936
Commit
b28e3936
authored
3 weeks ago
by
ft-Demo
Browse files
Options
Downloads
Patches
Plain Diff
commit by robo pro coding
parent
961b6997
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
RoboMission_line_demo.blockly
+87
-23
87 additions, 23 deletions
RoboMission_line_demo.blockly
RoboMission_line_demo.py
+22
-7
22 additions, 7 deletions
RoboMission_line_demo.py
with
109 additions
and
30 deletions
RoboMission_line_demo.blockly
+
87
−
23
View file @
b28e3936
...
...
@@ -64,31 +64,95 @@
</block>
</value>
<statement name="DO0">
<block type="encodermotor_set_values" id="Z@=?{[tj5~?DLR*G0dFo">
<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="~Y^k_kH}Ue2*2=C9]xnK">
<field name="MOTOR_NUM">512</field>
</shadow>
</value>
<value name="distance">
<shadow type="math_number" id="M%4hry1UKEs94)Z8Xq@I">
<field name="NUM">161</field>
</shadow>
<block type="controls_if" id="4]LYz/pXH@O+g7hWfWT%">
<mutation elseif="0" else="1"/>
<value name="IF0">
<block type="logic_boolean" id="t[Rk12I7!/9w`kN/s;}i">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="util_wait_until" id="0$XmP}:vOJs@k%cV`voh">
<value name="value">
<block type="encodermotor_position_read" id="I$*nar{B,#r5)=fU:IL1">
<field name="instance_name">vv6o.D]}g0#Ew7C~xfQ1-7dv9-J9W4.H3uoY}xp[W</field>
<statement name="DO0">
<block type="encodermotor_set_values" id="in^{uc76|S9V]gqI?=:V">
<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="DYO4{1^@pk-IjJdD$RP%">
<field name="MOTOR_NUM">512</field>
</shadow>
</value>
<value name="distance">
<shadow type="math_number" id="Qsn9}PV]`,H9FJ!gLLpc">
<field name="NUM">161</field>
</shadow>
</value>
<next>
<block type="util_wait_until" id="1-.$]njkj4Vn#Q`$x]SS">
<value name="value">
<block type="encodermotor_position_read" id="X.O3hxd~[A;1H.QOc2Tf">
<field name="instance_name">vv6o.D]}g0#Ew7C~xfQ1-7dv9-J9W4.H3uoY}xp[W</field>
</block>
</value>
<next>
<block type="encodermotor_stop" id="}0;mhg%d)cgwX;68yhGx">
<mutation syncBlocks="1"/>
<field name="instance_name_0">vv6o.D]}g0#Ew7C~xfQ1-7dv9-J9W4.H3uoY}xp[W</field>
<field name="instance_name_1">vv6o.D]}g0#Ew7C~xfQ1-[rGZ27?2t_Go?A6:UHM*</field>
<next>
<block type="variables_set" id="n#!MIBtqVQ;m6IWR?Oi@">
<field name="VAR" id="VuwL=OdJ![_3P78nRW#}">started</field>
<value name="VALUE">
<block type="logic_boolean" id="sl8H6#}xCCi4x;hDliB9">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="util_wait_until" id="?-mKm%]IWM[?v},8_]Am">
<value name="value">
<block type="variables_get" id="Lio.U|WchRGOfz*J4#AP">
<field name="VAR" id="VuwL=OdJ![_3P78nRW#}">started</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<statement name="ELSE">
<block type="encodermotor_set_values" id="Z@=?{[tj5~?DLR*G0dFo">
<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="~Y^k_kH}Ue2*2=C9]xnK">
<field name="MOTOR_NUM">512</field>
</shadow>
</value>
<value name="distance">
<shadow type="math_number" id="M%4hry1UKEs94)Z8Xq@I">
<field name="NUM">161</field>
</shadow>
</value>
<next>
<block type="util_wait_until" id="0$XmP}:vOJs@k%cV`voh">
<value name="value">
<block type="encodermotor_position_read" id="I$*nar{B,#r5)=fU:IL1">
<field name="instance_name">vv6o.D]}g0#Ew7C~xfQ1-7dv9-J9W4.H3uoY}xp[W</field>
</block>
</value>
</block>
</next>
</block>
</
nex
t>
</
statemen
t>
</block>
</statement>
<value name="IF1">
...
...
@@ -167,7 +231,7 @@
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="([,q3;KDt25p^%ZYwL4r" x="0" y="
780
">
<block type="procedures_defnoreturn" id="([,q3;KDt25p^%ZYwL4r" x="0" y="
1069
">
<field name="NAME">thread_display_update</field>
<statement name="STACK">
<block type="display_set_button_enabled" id="R+*qC2@{F,.u[/yT_|/o">
...
...
@@ -284,7 +348,7 @@
</block>
</statement>
</block>
<block type="display_on_button_clicked" id="h9NEZ1yTj+pDceca-h/n" x="0" y="1
166
">
<block type="display_on_button_clicked" id="h9NEZ1yTj+pDceca-h/n" x="0" y="1
455
">
<field name="instance_name">txt_button_start</field>
<statement name="statement">
<block type="variables_set" id="Z8*_J+Em!H4iE==YSjZ#">
...
...
This diff is collapsed.
Click to expand it.
RoboMission_line_demo.py
+
22
−
7
View file @
b28e3936
...
...
@@ -42,13 +42,28 @@ while True:
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
)
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
)
if
True
:
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
)
TXT_M_M1_encodermotor
.
stop_sync
(
TXT_M_M2_encodermotor
)
started
=
False
while
True
:
if
started
:
break
time
.
sleep
(
0.010
)
else
:
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_endline
():
TXT_M_M1_encodermotor
.
set_speed
(
int
(
512
),
Motor
.
CCW
)
TXT_M_M2_encodermotor
.
set_speed
(
int
(
512
),
Motor
.
CW
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment