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

commit by robo pro coding

parent 47c754ba
No related branches found
No related tags found
No related merge requests found
<xml xmlns="https://developers.google.com/blockly/xml" version="16">
<block type="start_block" id="lqhUEPzm*||%(m@[]/6W" deletable="false" x="4" y="-66">
<block type="start_block" id="lqhUEPzm*||%(m@[]/6W" deletable="false" x="0" y="0">
<statement name="statement">
<block type="import_function_noreturn" id="i^GTao7!8S1,xho4YgV/">
<mutation parentId="=AVbz0T*e!H|r6VtF=x7" parentFilename="lib/servo.py"/>
<field name="name">init_calib_servo</field>
<data>{"id":"=AVbz0T*e!H|r6VtF=x7","filename":"lib/servo.py"}</data>
<block type="text_print" id="8ZO2eyTP@5nDQtHu|NgP">
<value name="TEXT">
<shadow type="text" id="V~GIT-`LS)n{FsEgI6Mq">
<field name="TEXT">init program...</field>
</shadow>
</value>
<next>
<block type="import_function_noreturn" id="v|j/[Ojx/tjZ.b@hS_B|">
<mutation parentId="wdW1!p84BfPYu,HinNK3" parentFilename="lib/motor.py"/>
<field name="name">init_calib_motor</field>
<data>{"id":"wdW1!p84BfPYu,HinNK3","filename":"lib/motor.py"}</data>
<block type="import_function_noreturn" id="i^GTao7!8S1,xho4YgV/">
<mutation parentId="=AVbz0T*e!H|r6VtF=x7" parentFilename="lib/servo.py"/>
<field name="name">init_calib_servo</field>
<data>{"id":"=AVbz0T*e!H|r6VtF=x7","filename":"lib/servo.py"}</data>
<next>
<block type="loop_endless" id="hsFf7qj/+-ZR-Lbepm;B"/>
<block type="import_function_noreturn" id="v|j/[Ojx/tjZ.b@hS_B|">
<mutation parentId="wdW1!p84BfPYu,HinNK3" parentFilename="lib/motor.py"/>
<field name="name">init_calib_motor</field>
<data>{"id":"wdW1!p84BfPYu,HinNK3","filename":"lib/motor.py"}</data>
<next>
<block type="import_function_noreturn" id="*@E,b!ufM@dr62#C63g1" inline="true">
<mutation parentId="c`MlT]_.7(H9vBGb.g!Y" parentFilename="lib/motor.py"/>
<field name="name">set_speed</field>
<data>{"id":"c`MlT]_.7(H9vBGb.g!Y","filename":"lib/motor.py"}</data>
<value name="sp">
<block type="math_number" id=":tb91`a2Q[#q7]fhZBDd">
<field name="NUM">512</field>
</block>
</value>
<next>
<block type="procedures_callnoreturn" id="J}jLKFPjZCIl_uB{G76Z">
<mutation name="test_motor_async"/>
<next>
<block type="procedures_callnoreturn" id="e$hz#I(K^Y?1`$#$Vy]o">
<mutation name="test_motor_sync"/>
<next>
<block type="procedures_callnoreturn" id="a%38Rc0N%Y^|2-_TgAHi">
<mutation name="test_servo"/>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="3-dwu/)30vJOJ]4Fz8VQ" x="0" y="295">
<field name="NAME">test_motor_async</field>
<statement name="STACK">
<block type="text_print" id="0dl;T%+aV.1,`)iu:kvZ">
<value name="TEXT">
<shadow type="text" id="Dmp8:+`wC8_)+_kkRmjz">
<field name="TEXT">motor async</field>
</shadow>
</value>
<next>
<block type="import_function_noreturn" id="Y]9wEHd`N%(uvn=y^is)">
<mutation parentId="~.#zx,4UWf^8MH5:w_.X" parentFilename="lib/motor.py"/>
<field name="name">fwd_async</field>
<data>{"id":"~.#zx,4UWf^8MH5:w_.X","filename":"lib/motor.py"}</data>
<next>
<block type="util_wait_for" id="VC=SR$1?,yYpC8/x*x4T">
<field name="format">s</field>
<value name="value">
<shadow type="math_number" id="e+cdFo~M@mf9C:Yca8*I">
<field name="NUM">1</field>
</shadow>
</value>
<next>
<block type="import_function_noreturn" id="#ZrAejkO,q(*_K)OYez6">
<mutation parentId="(R~shCAxUL,iEA?OxqS+" parentFilename="lib/motor.py"/>
<field name="name">rotL_async</field>
<data>{"id":"(R~shCAxUL,iEA?OxqS+","filename":"lib/motor.py"}</data>
<next>
<block type="util_wait_for" id=")LXCy05nX;*pjt0*X+8@">
<field name="format">s</field>
<value name="value">
<shadow type="math_number" id="Kzd2M7$}`ix3L_j,vlzK">
<field name="NUM">1</field>
</shadow>
</value>
<next>
<block type="import_function_noreturn" id="RR8kVq8sTY[=lQ-^Q?~R">
<mutation parentId="p07Z)W:*V*_-XBccFOK|" parentFilename="lib/motor.py"/>
<field name="name">rotR_async</field>
<data>{"id":"p07Z)W:*V*_-XBccFOK|","filename":"lib/motor.py"}</data>
<next>
<block type="util_wait_for" id="{OH;qg~@dNa6qoed3hL$">
<field name="format">s</field>
<value name="value">
<shadow type="math_number" id="#Zai9bc,eCv8z*x%{m9g">
<field name="NUM">1</field>
</shadow>
</value>
<next>
<block type="import_function_noreturn" id="Qwg_L#x/vGOE8~!RV^Wc">
<mutation parentId="}Z@_ijb2SLCx8pL,a9Ks" parentFilename="lib/motor.py"/>
<field name="name">bwd_async</field>
<data>{"id":"}Z@_ijb2SLCx8pL,a9Ks","filename":"lib/motor.py"}</data>
<next>
<block type="util_wait_for" id="u=ff9_Xf=Mm!/ddFxXjw">
<field name="format">s</field>
<value name="value">
<shadow type="math_number" id=";9OFD*Zk%dJkeQVi4!(+">
<field name="NUM">1</field>
</shadow>
</value>
<next>
<block type="import_function_noreturn" id="vzIc@@B8Zh-~ziONI)I{">
<mutation parentId=",aCk6:4=ibIK@F:;??Hq" parentFilename="lib/motor.py"/>
<field name="name">fwd_m1_async</field>
<data>{"id":",aCk6:4=ibIK@F:;??Hq","filename":"lib/motor.py"}</data>
<next>
<block type="util_wait_for" id="Njt$A(eV%O$m-^au{PyL">
<field name="format">s</field>
<value name="value">
<shadow type="math_number" id="RtM|:5FKo4v|BJ6Qu32b">
<field name="NUM">1</field>
</shadow>
</value>
<next>
<block type="import_function_noreturn" id="jPS!T|{Z[Y/9U{e@(l|J">
<mutation parentId="4vrNky.qeQsWdvplsGqL" parentFilename="lib/motor.py"/>
<field name="name">fwd_m2_async</field>
<data>{"id":"4vrNky.qeQsWdvplsGqL","filename":"lib/motor.py"}</data>
<next>
<block type="util_wait_for" id="fd%AdOtv#x*RLu6j0_aE">
<field name="format">s</field>
<value name="value">
<shadow type="math_number" id="bEq3Y,==TmYQ@8a8AtW)">
<field name="NUM">1</field>
</shadow>
</value>
<next>
<block type="import_function_noreturn" id="GdmVUy(Jk-#GmYJp_kC{">
<mutation parentId=":DS7`}kQWJsznS=qQAI1" parentFilename="lib/motor.py"/>
<field name="name">stop_async</field>
<data>{"id":":DS7`}kQWJsznS=qQAI1","filename":"lib/motor.py"}</data>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="(IA*N/n[x?cihX[eJZa^" x="0" y="783">
<field name="NAME">test_motor_sync</field>
<statement name="STACK">
<block type="text_print" id="{!qm?@Oj8QpwPZRrELnD">
<value name="TEXT">
<shadow type="text" id="zI13@r8/+?9Sk0.3SV|Y">
<field name="TEXT">motor sync</field>
</shadow>
</value>
<next>
<block type="import_function_noreturn" id="sFc:ZS1j:{35YB;Ly[f5" inline="true">
<mutation parentId="/)AOQ`t%5y}WIz%j$2:m" parentFilename="lib/motor.py"/>
<field name="name">fwd_sync</field>
<data>{"id":"/)AOQ`t%5y}WIz%j$2:m","filename":"lib/motor.py"}</data>
<value name="cm">
<block type="math_number" id="%m!g)IS|8fm6%@Um1Y;I">
<field name="NUM">20</field>
</block>
</value>
<next>
<block type="import_function_noreturn" id="Ti,bx`$T[-);DVj/YzNl" inline="true">
<mutation parentId="rsq;%AKsNc9W5gQdN50V" parentFilename="lib/motor.py"/>
<field name="name">turn_sync</field>
<data>{"id":"rsq;%AKsNc9W5gQdN50V","filename":"lib/motor.py"}</data>
<value name="deg">
<block type="math_number" id="IlQc#^99L%-FtgidT4ZR">
<field name="NUM">90</field>
</block>
</value>
<next>
<block type="import_function_noreturn" id="y,#.0J0SRD$FvT%P.6S$" inline="true">
<mutation parentId="rsq;%AKsNc9W5gQdN50V" parentFilename="lib/motor.py"/>
<field name="name">turn_sync</field>
<data>{"id":"rsq;%AKsNc9W5gQdN50V","filename":"lib/motor.py"}</data>
<value name="deg">
<block type="math_number" id="u3Du=2TS@1zznuoJ-HKL">
<field name="NUM">-90</field>
</block>
</value>
<next>
<block type="import_function_noreturn" id="cCmF~!X`,oLxffH//2sp" inline="true">
<mutation parentId="WDNitKN~+i/oHh]Km}X1" parentFilename="lib/motor.py"/>
<field name="name">bwd_sync</field>
<data>{"id":"WDNitKN~+i/oHh]Km}X1","filename":"lib/motor.py"}</data>
<value name="cm">
<block type="math_number" id="e2JtCz.3a9eyog-,D3;_">
<field name="NUM">20</field>
</block>
</value>
<next>
<block type="import_function_noreturn" id="Hih2216UpXT^K2jXA9oi" inline="true">
<mutation parentId="rsq;%AKsNc9W5gQdN50V" parentFilename="lib/motor.py"/>
<field name="name">turn_sync</field>
<data>{"id":"rsq;%AKsNc9W5gQdN50V","filename":"lib/motor.py"}</data>
<value name="deg">
<block type="math_number" id="IbSV;`g)H.L8=#b}tK}T">
<field name="NUM">360</field>
</block>
</value>
<next>
<block type="import_function_noreturn" id="(;(f.JV+C:F24YX#9/ez">
<mutation parentId="bEj39MrcmW_{F-~ZDxkz" parentFilename="lib/motor.py"/>
<field name="name">stop_sync</field>
<data>{"id":"bEj39MrcmW_{F-~ZDxkz","filename":"lib/motor.py"}</data>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="3|%tVCPcBW|wKirF[ytH" x="0" y="1118">
<field name="NAME">test_servo</field>
<statement name="STACK">
<block type="text_print" id="iwF?!.`$Bouf$0(_/5.t">
<value name="TEXT">
<shadow type="text" id="Wwcy+{L6|k$mbE$i+kH;">
<field name="TEXT">servo</field>
</shadow>
</value>
</block>
</statement>
</block>
</xml>
\ No newline at end of file
import time
from lib.controller import *
from lib.motor import *
from lib.servo import *
def test_motor_async():
print('motor async')
fwd_async()
time.sleep(1)
rotL_async()
time.sleep(1)
rotR_async()
time.sleep(1)
bwd_async()
time.sleep(1)
fwd_m1_async()
time.sleep(1)
fwd_m2_async()
time.sleep(1)
stop_async()
def test_motor_sync():
print('motor sync')
fwd_sync(20)
turn_sync(90)
turn_sync(-90)
bwd_sync(20)
turn_sync(360)
stop_sync()
def test_servo():
print('servo')
print('init program...')
init_calib_servo()
init_calib_motor()
while True:
pass
set_speed(512)
test_motor_async()
test_motor_sync()
test_servo()
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