Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BTSmart_Useless_Machine_2
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
Smart Robots Pro
BTSmart_Useless_Machine_2
Commits
eef3fa4c
Commit
eef3fa4c
authored
1 year ago
by
ft-Demo
Browse files
Options
Downloads
Patches
Plain Diff
commit by robo pro coding
parent
cca12bdd
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
BTSmart_Useless_Machine_2.blockly
+43
-49
43 additions, 49 deletions
BTSmart_Useless_Machine_2.blockly
BTSmart_Useless_Machine_2.js
+20
-18
20 additions, 18 deletions
BTSmart_Useless_Machine_2.js
with
63 additions
and
67 deletions
BTSmart_Useless_Machine_2.blockly
+
43
−
49
View file @
eef3fa4c
<xml xmlns="https://developers.google.com/blockly/xml" version="14">
<block type="start_block" id="DN^mJ1;up%ZB3(H0BtNd" deletable="false" x="-
388
" y="-
442
">
<block type="start_block" id="DN^mJ1;up%ZB3(H0BtNd" deletable="false" x="-
442
" y="-
706
">
<statement name="statement">
<block type="motor_set_speed" id="nTe94(WV-mL2-hcY71fi">
<field name="instance_name">BTSmart_M2_motor</field>
...
...
@@ -22,70 +22,64 @@
<block type="motor_stop" id="dtiJ|D]!P:/4xL45hPD{">
<field name="instance_name">BTSmart_M2_motor</field>
<next>
<block type="controls_if" id="9Y.V,oZ(=E:Dh7b{Ayo*">
<value name="IF0">
<block type="input_mini_switch_if_state" id="NKz=ayh8=S`LlH(_3-bj">
<field name="instance_name">BTSmart_I4_mini_switch</field>
<field name="property_name">closed</field>
</block>
</value>
<statement name="DO0">
<block type="motor_set_speed" id="zgHghI#{ZTZfViQCDEk2">
<field name="instance_name">BTSmart_M1_motor</field>
<field name="direction">Motor.CW</field>
<value name="speed">
<shadow type="motor_number" id="(t$*Sz5^8A4]hON1bfbD">
<field name="MOTOR_NUM">512</field>
</shadow>
<block type="loop_endless" id="X*?KRqC;0BDwI}TvYO2$">
<statement name="DO">
<block type="controls_if" id="9Y.V,oZ(=E:Dh7b{Ayo*">
<value name="IF0">
<block type="input_mini_switch_if_state" id="NKz=ayh8=S`LlH(_3-bj">
<field name="instance_name">BTSmart_I4_mini_switch</field>
<field name="property_name">closed</field>
</block>
</value>
<
next
>
<block type="util_wait_for" id="
HvvT6S]0pJ*S@9v:@$fj
">
<
statement name="DO0"
>
<block type="util_wait_for" id="
$UzeA6.Y^JSb3@LA[0m2
">
<field name="format">s</field>
<value name="value">
<shadow type="math_number" id="
]O@G77Bnh$]rfbH9v0*6
">
<field name="NUM">0.
5
</field>
<shadow type="math_number" id="
;vhAd1gBNrObU|%[KM?R
">
<field name="NUM">0.
6
</field>
</shadow>
</value>
<next>
<block type="motor_s
top" id="h41a*=0a5$bP=yQy*1bK
">
<block type="motor_s
et_speed" id="zgHghI#{ZTZfViQCDEk2
">
<field name="instance_name">BTSmart_M1_motor</field>
<field name="direction">Motor.CW</field>
<value name="speed">
<shadow type="motor_number" id="(t$*Sz5^8A4]hON1bfbD">
<field name="MOTOR_NUM">512</field>
</shadow>
</value>
<next>
<block type="util_wait_for" id="
rCWLfIcN_ouZ+[.^?Tn|
">
<block type="util_wait_for" id="
HvvT6S]0pJ*S@9v:@$fj
">
<field name="format">s</field>
<value name="value">
<shadow type="math_number" id="
P8B8Y%zg0uP-5KZv@@8A
">
<shadow type="math_number" id="
]O@G77Bnh$]rfbH9v0*6
">
<field name="NUM">0.5</field>
</shadow>
</value>
<next>
<block type="motor_set_speed" id="CGDPu5?8MOe=-Dp[^FcB">
<field name="instance_name">BTSmart_M2_motor</field>
<field name="direction">Motor.CW</field>
<value name="speed">
<shadow type="motor_number" id="GztRoWNor#ELq9DL`]/k">
<field name="MOTOR_NUM">512</field>
</shadow>
</value>
<block type="motor_stop" id="h41a*=0a5$bP=yQy*1bK">
<field name="instance_name">BTSmart_M1_motor</field>
<next>
<block type="
controls_whileUntil" id="F{soZLKN:P,~/,nSB{Nz
">
<field name="
MODE">UNTIL
</field>
<
value
name="
BOOL"
>
<block type="input_mini_switch_if_state" id="A:%l2Xq0`MZ(@BlWqFI$
">
<field name="instance_name">BTSmart_I4_mini_switch</field
>
<field name="
property_name">open
</field>
</
block
>
<block type="
motor_set_speed" id="CGDPu5?8MOe=-Dp[^FcB
">
<field name="
instance_name">BTSmart_M2_motor
</field>
<
field
name="
direction">Motor.CW</field
>
<value name="speed
">
<shadow type="motor_number" id="GztRoWNor#ELq9DL`]/k"
>
<field name="
MOTOR_NUM">512
</field>
</
shadow
>
</value>
<next>
<block type="motor_stop" id="M*)NFsHtWo-RCnW0uIuc">
<field name="instance_name">BTSmart_M1_motor</field>
<block type="controls_whileUntil" id="F{soZLKN:P,~/,nSB{Nz">
<field name="MODE">UNTIL</field>
<value name="BOOL">
<block type="input_mini_switch_if_state" id="A:%l2Xq0`MZ(@BlWqFI$">
<field name="instance_name">BTSmart_I4_mini_switch</field>
<field name="property_name">open</field>
</block>
</value>
<next>
<block type="util_wait_for" id="j{:jJC+p%La6;cYm!;8#">
<field name="format">s</field>
<value name="value">
<shadow type="math_number" id="LqC)q-Pd/2A6at;$zuk!">
<field name="NUM">0.5</field>
</shadow>
</value>
<block type="motor_stop" id="M*)NFsHtWo-RCnW0uIuc">
<field name="instance_name">BTSmart_M1_motor</field>
<next>
<block type="motor_set_speed" id="GwjQrc2c4#Q73i(y=z#l">
<field name="instance_name">BTSmart_M2_motor</field>
...
...
@@ -121,7 +115,7 @@
<field name="format">s</field>
<value name="value">
<shadow type="math_number" id="G:xY#goYg,$0MzHObr@@">
<field name="NUM">0.
5
</field>
<field name="NUM">0.
4
</field>
</shadow>
</value>
<next>
...
...
@@ -152,7 +146,7 @@
</block>
</next>
</block>
</
nex
t>
</
statemen
t>
</block>
</statement>
</block>
...
...
This diff is collapsed.
Click to expand it.
BTSmart_Useless_Machine_2.js
+
20
−
18
View file @
eef3fa4c
...
...
@@ -3,23 +3,25 @@ while (!(await BTSmart_I2_mini_switch.isClosed())) {
await
Utility
.
sleep
(
10
);
}
await
BTSmart_M2_motor
.
stop
();
if
(
await
BTSmart_I4_mini_switch
.
isClosed
())
{
await
BTSmart_M1_motor
.
setSpeed
(
512
,
Motor
.
CW
);
await
Utility
.
sleep
(
500
);
await
BTSmart_M1_motor
.
stop
();
await
Utility
.
sleep
(
500
);
await
BTSmart_M2_motor
.
setSpeed
(
512
,
Motor
.
CW
);
while
(
!
(
await
BTSmart_I4_mini_switch
.
isOpen
()))
{
await
Utility
.
sleep
(
10
);
while
(
true
)
{
if
(
await
BTSmart_I4_mini_switch
.
isClosed
())
{
await
Utility
.
sleep
(
600
);
await
BTSmart_M1_motor
.
setSpeed
(
512
,
Motor
.
CW
);
await
Utility
.
sleep
(
500
);
await
BTSmart_M1_motor
.
stop
();
await
BTSmart_M2_motor
.
setSpeed
(
512
,
Motor
.
CW
);
while
(
!
(
await
BTSmart_I4_mini_switch
.
isOpen
()))
{
await
Utility
.
sleep
(
10
);
}
await
BTSmart_M1_motor
.
stop
();
await
BTSmart_M2_motor
.
setSpeed
(
512
,
Motor
.
CCW
);
while
(
!
(
await
BTSmart_I2_mini_switch
.
isClosed
()))
{
await
Utility
.
sleep
(
10
);
}
await
BTSmart_M2_motor
.
stop
();
await
BTSmart_M1_motor
.
setSpeed
(
512
,
Motor
.
CCW
);
await
Utility
.
sleep
(
400
);
await
BTSmart_M1_motor
.
stop
();
}
await
BTSmart_M1_motor
.
stop
();
await
Utility
.
sleep
(
500
);
await
BTSmart_M2_motor
.
setSpeed
(
512
,
Motor
.
CCW
);
while
(
!
(
await
BTSmart_I2_mini_switch
.
isClosed
()))
{
await
Utility
.
sleep
(
10
);
}
await
BTSmart_M2_motor
.
stop
();
await
BTSmart_M1_motor
.
setSpeed
(
512
,
Motor
.
CCW
);
await
Utility
.
sleep
(
500
);
await
BTSmart_M1_motor
.
stop
();
await
Utility
.
sleep
(
10
);
}
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