-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.blocks
1 lines (1 loc) · 6.55 KB
/
main.blocks
1
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="O3Ve{wHnz=w9#0Tnxr|d">list</variable><variable id="s$fIqgf[HT45KN#{^K*a">count</variable><variable id="wRf*+XM[{0#zLyY9p/XX">index</variable></variables><block type="pxt-on-start" id="/U-w%JTC.Gd#{NVmuby6" x="8" y="0"><statement name="HANDLER"><block type="radio_set_group" id="dyMK@$^~{+-(*PV6_pG|"><value name="ID"><shadow type="math_number_minmax" id="NSdrCk1,h!7wO6)u7/?@"><mutation min="0" max="255" label="Id" precision="0"/><field name="SLIDER">1</field></shadow></value></block></statement></block><block type="radio_on_string_drag" id="5M1z9uF_wK(PNDg}KG~f" x="0" y="203"><comment pinned="true" h="80" w="160">Combine the 3 radio messages into 1 line of text</comment><value name="HANDLER_DRAG_PARAM_receivedString"><shadow type="argument_reporter_string" id="+4.fR[LxBS-5v3BBQ7wa"><field name="VALUE">receivedString</field></shadow></value><statement name="HANDLER"><block type="controls_if" id="9lXQs8:3OCpUqcDR:1b}"><mutation else="1"/><comment pinned="true" h="80" w="160">Detect the 1st message</comment><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="vKL8MpxlPl5,UXXXaa*u"><field name="OP">EQ</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="string_get" id="VHSQl_B-/Eje5MM3oe[q"><value name="this"><shadow type="text"><field name="TEXT">this</field></shadow><block type="argument_reporter_string" id=";3mo+`.:NZnBBd0.p;9P"><field name="VALUE">receivedString</field></block></value><value name="pos"><shadow type="math_number" id="c7iBhKgg})`Acm;QLX|G"><field name="NUM">0</field></shadow></value></block></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="text" id="HC}YG|Yqw?z2Bbq4}w.J"><field name="TEXT">*</field></block></value></block></value><statement name="DO0"><block type="variables_set" id="1$Z]lMM~9_)8uk~5T*FE"><field name="VAR" id="s$fIqgf[HT45KN#{^K*a">count</field><value name="VALUE"><shadow type="math_number" id="(]H6~~B-MEN]x4Z*LZ3q"><field name="NUM">0</field></shadow></value><next><block type="variables_set" id="2S~]5,|JMUED-){f[fgc"><field name="VAR" id="O3Ve{wHnz=w9#0Tnxr|d">list</field><value name="VALUE"><block type="lists_create_with" id="CILst|19pL^mD9]HbC8G"><mutation items="0"/></block></value><next><block type="lists_index_set" id="I(DCs3(o1kKK8oK^{M_x"><comment pinned="false" h="80" w="160">Strip off the leading * and add the message to list</comment><value name="LIST"><block type="variables_get" id="J2SXLOM{L1|iX,t!HWU("><field name="VAR" id="O3Ve{wHnz=w9#0Tnxr|d">list</field></block></value><value name="INDEX"><shadow type="math_number" id="a-KcXtY)CT1cm}~vEX2{"><field name="NUM">0</field></shadow></value><value name="VALUE"><block type="string_substr" id="!MXly({Yu0QLusOov7/4"><value name="this"><shadow type="text"><field name="TEXT">this</field></shadow><block type="argument_reporter_string" id="},G?mZO0OO!+$7.zT?UJ"><field name="VALUE">receivedString</field></block></value><value name="start"><shadow type="math_number" id="[M.Wi!AENhuTZ+T?X9rW"><field name="NUM">1</field></shadow></value><value name="length"><shadow type="math_number" id="(]F6)]9An_~_71vn30h#"><field name="NUM">16</field></shadow></value></block></value><next><block type="radio_datagram_send_string" id="~G~2.7k}U?BlW}.=,CFA"><comment pinned="true" h="80" w="160">Send ACK to weather station </comment><value name="msg"><shadow type="text" id=".LPYP?/~IB:;UNh_hp{o"><field name="TEXT">ACK</field></shadow></value></block></next></block></next></block></next></block></statement><statement name="ELSE"><block type="array_push" id="Re/E2Wn7^@:?:0g]nYMh"><comment pinned="true" h="80" w="160">Add the 2nd and 3rd mesages</comment><value name="list"><block type="variables_get" id="Y[@;yv{rXrC~RSmJsN~$"><field name="VAR" id="O3Ve{wHnz=w9#0Tnxr|d">list</field></block></value><value name="value"><block type="argument_reporter_string" id="20%IOBkci(gg^?Y0H5*n"><field name="VALUE">receivedString</field></block></value><next><block type="variables_change" id="H!mW9E,|)qRB}Ju~(/va"><field name="VAR" id="s$fIqgf[HT45KN#{^K*a">count</field><value name="VALUE"><shadow type="math_number" id="0h1HeBL7JC^RTh8}fFr1"><field name="NUM">1</field></shadow></value><next><block type="controls_if" id="kV`$8NA[gm.xbrUUtB,w"><comment pinned="true" h="80" w="160">Now send the messages to USB as 1 line of text</comment><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="{(e~$~WAc1c6gYB/{$/^"><field name="OP">EQ</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="m4~EQOI}}DIfdQ%T1Hk7"><field name="VAR" id="s$fIqgf[HT45KN#{^K*a">count</field></block></value><value name="B"><shadow type="math_number" id="JdLI+cgiRTFa1*fAJzIz"><field name="NUM">2</field></shadow></value></block></value><statement name="DO0"><block type="pxt_controls_for" id="P^bU3yMjY09h+YOC|=ym"><value name="VAR"><shadow type="variables_get_reporter" id="lXj;@#h(3q23W0/c:y|d"><field name="VAR" id="wRf*+XM[{0#zLyY9p/XX">index</field></shadow></value><value name="TO"><shadow type="math_whole_number" id="-dtF`4uBGl+-rbE,RON$"><field name="NUM">2</field></shadow></value><statement name="DO"><block type="serial_writestring" id="3FD3^FO14S-azi2ea4wn"><value name="text"><shadow type="text"><field name="TEXT"/></shadow><block type="text_join" id="wMGU9J.;5UZ_$VyrhXcN"><mutation items="2"/><value name="ADD0"><shadow type="text"><field name="TEXT">Hello</field></shadow><block type="lists_index_get" id="B)]J.Sss}pQca$kLApC/"><value name="LIST"><block type="variables_get" id="T-i_sOJDC86;eUR}sVGV"><field name="VAR" id="O3Ve{wHnz=w9#0Tnxr|d">list</field></block></value><value name="INDEX"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="pEK~CBwiBnG][+=)1;FX"><field name="VAR" id="wRf*+XM[{0#zLyY9p/XX">index</field></block></value></block></value><value name="ADD1"><shadow type="text" id="oUrzJ;[:$r-@hZRfjgKu"><field name="TEXT">,</field></shadow></value></block></value></block></statement><next><block type="serial_writeline" id=")@TP_oNi0K:#{5`80%BJ"><value name="text"><shadow type="text" id="/Ya#yN0L|3x[IZiF*r(="><field name="TEXT"/></shadow></value></block></next></block></statement><next><block type="radio_datagram_send_string" id="@Q^tnd=D4n^/X(VD`.hl"><value name="msg"><shadow type="text" id="CAOQixf7Dsx66O/jXvR%"><field name="TEXT">ACK</field></shadow></value></block></next></block></next></block></next></block></statement></block></statement></block></xml>