sudo gtktermでaを入れるとledオン繰り返す、それ以外を入れるとledオフになるブロックプログラミングはなかなか奥が深い
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable type="obniz" id="X2:3=S(hsdv0mk{aavHW">obniz</variable>
<variable type="uart" id=".%hlk#,Mm5h*Z7dI%6zS">uart</variable>
<variable type="led" id="79BWrnzKI24^:Bb/Ra!]">led</variable>
<variable id="o{V)0T-nogwYGhu1i))?">in</variable>
</variables>
<block type="obniz_connect" id="^u?]:ri|/4RV=L/w7Efp" x="153" y="-117">
<field name="obniz" id="X2:3=S(hsdv0mk{aavHW" variabletype="obniz">obniz</field>
<value name="obniz_id">
<shadow type="text" id="E:ZN0r+(9xl+UFYH+x=b">
<field name="TEXT">4998-4317</field>
</shadow>
</value>
<next>
<block type="obniz_parts_uart_wired" id="FZLIe1qMo#uREn]xN?OD">
<field name="obniz" id="X2:3=S(hsdv0mk{aavHW" variabletype="obniz">obniz</field>
<field name="uart" id=".%hlk#,Mm5h*Z7dI%6zS" variabletype="uart">uart</field>
<value name="rx">
<shadow type="math_number" id="/+YUzj:$]KCP+R_?XFDC">
<field name="NUM">0</field>
</shadow>
</value>
<value name="tx">
<shadow type="math_number" id="4*aDd2@}@ZE2);.6bvfl">
<field name="NUM">1</field>
</shadow>
</value>
<value name="baud">
<shadow type="math_number" id="5cwV|Cy=1i1#LhtPTm#k">
<field name="NUM">115200</field>
</shadow>
</value>
<next>
<block type="obniz_parts_led_wired" id="ROR%8a=dZ~zojZMa^$jq">
<field name="obniz" id="X2:3=S(hsdv0mk{aavHW" variabletype="obniz">obniz</field>
<field name="LED" id="79BWrnzKI24^:Bb/Ra!]" variabletype="led">led</field>
<value name="anode">
<shadow type="math_number" id="09Xb6qBb4p(r.VHQ]R_0">
<field name="NUM">2</field>
</shadow>
</value>
<value name="cathode">
<shadow type="math_number" id="%:_A*2].E(r/Vza1,UDL">
<field name="NUM">3</field>
</shadow>
</value>
<next>
<block type="obniz_util_repeat" id=":C}TRf~u[B}QU.,qe?6N">
<statement name="DO">
<block type="obniz_display_clear" id="L?yt@thCaI=J:Fl/Y#}J">
<field name="obniz" id="X2:3=S(hsdv0mk{aavHW" variabletype="obniz">obniz</field>
<next>
<block type="controls_if" id="@Igq53;9FM,Q?~Tp;_ut">
<value name="IF0">
<shadow type="logic_boolean" id="%_d?-IyrmgSLXjXmHlZ3">
<field name="BOOL">TRUE</field>
</shadow>
<block type="obniz_parts_uart_is_data_exists" id="}E7,!GNOFdjG:^-3)}/I">
<field name="uart" id=".%hlk#,Mm5h*Z7dI%6zS" variabletype="uart">uart</field>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="|7Quz8niyqz/c~P#5h@k">
<field name="VAR" id="o{V)0T-nogwYGhu1i))?">in</field>
<value name="VALUE">
<block type="obniz_parts_uart_read_text" id="/8j!H7_p5ln{Y^nu%{Pl">
<field name="uart" id=".%hlk#,Mm5h*Z7dI%6zS" variabletype="uart">uart</field>
</block>
</value>
</block>
</statement>
<next>
<block type="controls_if" id="JZ-l(ihNo]wzO]Xjm[Qa">
<comment id="undefined" pinned="true" h="97.04547119140625" w="254.3182373046875">aが置き換わらんかぎりここが実行される</comment>
<value name="IF0">
<shadow type="logic_boolean" id="ya1]93x#Z5;l23DRV_d,">
<field name="BOOL">TRUE</field>
</shadow>
<block type="logic_compare" id="A*Rst1S({_db)Cx=ftXz">
<field name="OP">EQ</field>
<value name="A">
<shadow type="math_number" id="uVjhnv#_zGMfE1otHpp6">
<field name="NUM">10</field>
</shadow>
<block type="variables_get" id="zElei4aB#Bc7{7%ElH5T">
<field name="VAR" id="o{V)0T-nogwYGhu1i))?">in</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="Q~8$@dgt6,]K!VT!{Sj(">
<field name="NUM">10</field>
</shadow>
<block type="text" id="B*1VTMGQF@lGC)8*aaL-">
<field name="TEXT">a</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="obniz_parts_led_on" id="p??8Wh.2UqS8RJ-+21PM">
<field name="LED" id="79BWrnzKI24^:Bb/Ra!]" variabletype="led">led</field>
<next>
<block type="obniz_wait" id="o0gZYo|QcF151C!)o(Qj">
<field name="obniz" id="X2:3=S(hsdv0mk{aavHW" variabletype="obniz">obniz</field>
<value name="time">
<shadow type="math_number" id="brJk7O+$K=YZo875mDHs">
<field name="NUM">500</field>
</shadow>
</value>
<next>
<block type="obniz_parts_led_off" id="luYU224-=6`*0,]N,yL~">
<field name="LED" id="79BWrnzKI24^:Bb/Ra!]" variabletype="led">led</field>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="obniz_wait" id="yA2x}EShij1_*$n.D~p)">
<field name="obniz" id="X2:3=S(hsdv0mk{aavHW" variabletype="obniz">obniz</field>
<value name="time">
<shadow type="math_number" id="D-}jOcs3cFlnL:q+246q">
<field name="NUM">500</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</xml>
---------simple radio control car -------------------------------------------------------
https://blog.obniz.com/make/kids-project-simple-rc-car
0 件のコメント:
コメントを投稿