-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.blocks
1 lines (1 loc) · 13.3 KB
/
main.blocks
1
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="WGriOA~!9KWi@M8nmjEG">neopixels</variable><variable id="1tD53t7Nu6Gc-y@WFI0n">strip</variable><variable id="K4eg.zj+`MOuu#H!cFt_">Red</variable><variable id="79%m=/T({qxamS4)9J;-">Blue</variable><variable id="M~(aL*tzB%22OsC/8P2g">Green</variable><variable id="9gr0cf)`crh#,HDpDu!^">range</variable><variable id="]@*}s9Q5(|ol2-5,Cm@Z">range2</variable><variable id="=Mdcq;-[ak|Xb._%sRKW">rate</variable><variable id="2FjMm]i},:,E@CE3kGS)">pixelsLit</variable><variable id="X}=Be79Fl5RJWc+:!BN%">pixelRotation</variable><variable id="8nOMIuvnvzWR=v^vZa^w">currentBrightness</variable><variable id="tY}aip5xv8BkrOl(Ml=*">ledsToLight</variable></variables><block type="pxt-on-start" id="#w,8b1dB!rBMw.Er6rzG" x="31" y="0"><statement name="HANDLER"><block type="variables_set" id="8IQjjw$;nXmx[eKH9Q,b"><field name="VAR" id="1tD53t7Nu6Gc-y@WFI0n">strip</field><comment>This sets a variable with the name "neopixels" and tells the micro:bit there are neopixels at a specific pin (p0 in this case) and how many LEDs there are (8 in this case)</comment><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="neopixel_create" id="o4pJtnUj}4(|)pkgSrn0"><field name="pin">DigitalPin.P0</field><field name="mode">NeoPixelMode.RGB</field><value name="numleds"><shadow type="math_number" id=")%3H2$X01A]$U%{WbU|j"><field name="NUM">16</field></shadow></value></block></value><next><block type="neopixel_show" id="J1Qaj{%3m_^e@O!m:!q|"><comment>Tells the micro:bit to actually turn the lights on how they have been programmed</comment><value name="strip"><block type="variables_get" id="Jh53O!08Qq*SAAXVEt7L"><field name="VAR" id="1tD53t7Nu6Gc-y@WFI0n">strip</field></block></value><next><block type="variables_set" id=":Kl:m9W^Y.ewX86]{s3;"><field name="VAR" id="2FjMm]i},:,E@CE3kGS)">pixelsLit</field><value name="VALUE"><shadow type="math_number" id=",Qg1ti,D[{iVB36xmmzN"><field name="NUM">1</field></shadow></value><next><block type="variables_set" id="mfZm~#Vj9qn(_R3GG~iM"><field name="VAR" id="X}=Be79Fl5RJWc+:!BN%">pixelRotation</field><value name="VALUE"><shadow type="math_number" id="HqBlU3`zK#C[|}z@)zp|"><field name="NUM">0</field></shadow></value><next><block type="neopixel_set_pixel_color" id="574]EM6%ooLjq=`@@m.@"><value name="strip"><block type="variables_get" id="Vo2OdkNu2es2:@#JW.2%"><field name="VAR" id="1tD53t7Nu6Gc-y@WFI0n">strip</field></block></value><value name="pixeloffset"><shadow type="math_number" id="z;C/`KM~DByp|K!n^^,g"><field name="NUM">0</field></shadow></value><value name="rgb"><shadow type="neopixel_colors"><field name="color">NeoPixelColors.Yellow</field></shadow><block type="neopixel_rgb" id="v.Zw4!:W.$agLz~{s,wL"><value name="red"><shadow type="math_number"><field name="NUM">255</field></shadow><block type="device_random" id="Z~DM6[Kx*M=6U(RmfCYr"><value name="min"><shadow type="math_number" id=":gG.B1$0j#m4q$8znIbi"><field name="NUM">0</field></shadow></value><value name="limit"><shadow type="math_number" id="|Vf_g4E?vtj-W+=a00rz"><field name="NUM">255</field></shadow></value></block></value><value name="green"><shadow type="math_number"><field name="NUM">255</field></shadow><block type="device_random" id="L)T]0(D8K/fX1S.%/_d!"><value name="min"><shadow type="math_number" id="mFz2bH;PwjZAXm@aj)5["><field name="NUM">0</field></shadow></value><value name="limit"><shadow type="math_number" id="e,g~vEtdB|#eE9Jw`KV2"><field name="NUM">255</field></shadow></value></block></value><value name="blue"><shadow type="math_number"><field name="NUM">255</field></shadow><block type="device_random" id="X8kilXC07w:kk}ZRw0^x"><value name="min"><shadow type="math_number" id=";v(0yyCc;`feG7Ik,VG!"><field name="NUM">0</field></shadow></value><value name="limit"><shadow type="math_number" id="!G]SnE5bfQ)eQ/Y]GH$}"><field name="NUM">255</field></shadow></value></block></value></block></value></block></next></block></next></block></next></block></next></block></statement></block><block type="device_forever" id="tLkH(F8wwISRH*NnOf8u" x="0" y="336"><statement name="HANDLER"><block type="variables_set" id="7|qgZ]9RN#cIXD=b:CQU"><field name="VAR" id="tY}aip5xv8BkrOl(Ml=*">ledsToLight</field><value name="VALUE"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="math_arithmetic" id="iQG;I4veK.8;E2aNt[rI"><field name="OP">MINUS</field><value name="A"><shadow type="math_number" id="Vy/U-xu]3s72Eh@4Q0+?"><field name="NUM">15</field></shadow></value><value name="B"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="math_js_round" id="P*nt2ro%L/x08D,I7Kc@"><field name="OP">round</field><value name="ARG0"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="math_map" id="N($8ks})6Nq?+83Jw9z2"><value name="value"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="math_constrain_value" id="v_f}IUdtD#-2vOI6Y.CZ"><value name="value"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="device_get_light_level" id="w5a4BrcAlCV~)SY3,xQh"/></value><value name="low"><shadow type="math_number" id=":mGfBoUp6](c)TQ$_yE!"><field name="NUM">0</field></shadow></value><value name="high"><shadow type="math_number" id="Nj{n7O+CWOXrsy8Rv],v"><field name="NUM">50</field></shadow></value></block></value><value name="fromLow"><shadow type="math_number" id="MLB[R0q;0=olIJWl,287"><field name="NUM">0</field></shadow></value><value name="fromHigh"><shadow type="math_number" id="cjPM^2k5U_)rD7euY:CT"><field name="NUM">50</field></shadow></value><value name="toLow"><shadow type="math_number" id="-qLX`8saKBr%h7l%GWtL"><field name="NUM">1</field></shadow></value><value name="toHigh"><shadow type="math_number" id="}jIMf`sWk~3xR{bb]~4x"><field name="NUM">15</field></shadow></value></block></value></block></value></block></value><next><block type="neopixel_rotate" id="b3s+{|eq5B2_-sDCehF6"><value name="strip"><block type="variables_get" id="L4PUANT/)hI:qhp)P[ub"><field name="VAR" id="1tD53t7Nu6Gc-y@WFI0n">strip</field></block></value><value name="offset"><shadow type="math_number" id="u]YvR20.{-oib4tO/3XQ"><field name="NUM">1</field></shadow></value><next><block type="variables_change" id="}|ocw)Jgso~7+_f)wZs+"><field name="VAR" id="X}=Be79Fl5RJWc+:!BN%">pixelRotation</field><value name="VALUE"><shadow type="math_number" id="2`vYz`u-Tl6JxUnBTTe_"><field name="NUM">1</field></shadow></value><next><block type="neopixel_show" id="|[lK{x/r(:S$j$]:h@1#"><value name="strip"><block type="variables_get" id="u8_FjPc(lV^b8~+RoM!b"><field name="VAR" id="1tD53t7Nu6Gc-y@WFI0n">strip</field></block></value><next><block type="device_pause" id="dx*8~)[Y)s$ef,*LGSw%"><value name="pause"><shadow type="timePicker"><field name="ms">20</field></shadow><block type="math_map" id=")r/f4~sJ28z_PXMpB!zW"><value name="value"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="math_constrain_value" id="3~;#s`R|E#mwr,CRTUp!"><value name="value"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="device_get_light_level" id="_US2/pjg*)#Hfhunf-[j"/></value><value name="low"><shadow type="math_number" id="u*Pk*42K]mxd:z.(J~7t"><field name="NUM">0</field></shadow></value><value name="high"><shadow type="math_number" id="4?zu:-UY?Z/,nbSq5B:."><field name="NUM">50</field></shadow></value></block></value><value name="fromLow"><shadow type="math_number" id="zcg!rkg@cb]2lW]6Us%1"><field name="NUM">0</field></shadow></value><value name="fromHigh"><shadow type="math_number" id="HYBC1J6,Kz.HMd[vRWc#"><field name="NUM">50</field></shadow></value><value name="toLow"><shadow type="math_number" id="N;|m3#l+pcg(,)tKe6tS"><field name="NUM">20</field></shadow></value><value name="toHigh"><shadow type="math_number" id="OxQ{LnNm/mxoxRA/}:sZ"><field name="NUM">100</field></shadow></value></block></value><next><block type="controls_if" id=")v#}~.P%@o%IW6k-+my/"><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="4~DX*BH=(8-Qin0(s(ug"><field name="OP">GT</field><value name="A"><shadow type="text"><field name="TEXT"/></shadow><block type="variables_get" id="*QcaK~c=|-jj3L`FYNGs"><field name="VAR" id="X}=Be79Fl5RJWc+:!BN%">pixelRotation</field></block></value><value name="B"><shadow type="text"><field name="TEXT">15</field></shadow><block type="math_number" id="LpQ{9Ne]A=DhnPn4l]dT"><field name="NUM">15</field></block></value></block></value><statement name="DO0"><block type="variables_set" id="?%sH6CyN=o/Lc)lEYZ_E"><field name="VAR" id="X}=Be79Fl5RJWc+:!BN%">pixelRotation</field><value name="VALUE"><shadow type="math_number" id="iL=*]3M4z:T5t76p.e8Y"><field name="NUM">0</field></shadow></value><next><block type="controls_if" id="6VHPba=};$s~u4Lfy1ns"><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="?)wTK;dxY)V]HQRNOl.)"><field name="OP">GT</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="Xlf:Qd2sl_[l=Z5E7M%,"><field name="VAR" id="tY}aip5xv8BkrOl(Ml=*">ledsToLight</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">64</field></shadow><block type="variables_get" id="=4KAK2R]mNtO#f`ryHJz"><field name="VAR" id="2FjMm]i},:,E@CE3kGS)">pixelsLit</field></block></value></block></value><statement name="DO0"><block type="neopixel_set_pixel_color" id="M)%Jn990x2%|n;]Z~#^:"><value name="strip"><block type="variables_get" id="oGnc6R%*qn`a2vZS/(:c"><field name="VAR" id="1tD53t7Nu6Gc-y@WFI0n">strip</field></block></value><value name="pixeloffset"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="Vj|K]$mt,sgD/pnfILj1"><field name="VAR" id="2FjMm]i},:,E@CE3kGS)">pixelsLit</field></block></value><value name="rgb"><shadow type="neopixel_colors"><field name="color">NeoPixelColors.Yellow</field></shadow><block type="neopixel_rgb" id="KqH*^~XcVyL%#-O%_fWf"><value name="red"><shadow type="math_number"><field name="NUM">255</field></shadow><block type="device_random" id="@6^oPJr`PS{`R@U3xx$P"><value name="min"><shadow type="math_number" id="?~-nBBU.tU:p9k5qJowM"><field name="NUM">0</field></shadow></value><value name="limit"><shadow type="math_number" id="DIoT2A+dcQAo-{G6NCvX"><field name="NUM">255</field></shadow></value></block></value><value name="green"><shadow type="math_number"><field name="NUM">255</field></shadow><block type="device_random" id="9h#6(2V0./3^uIN,4dj*"><value name="min"><shadow type="math_number" id="FHU*{AX2-E(;rkyby]TU"><field name="NUM">0</field></shadow></value><value name="limit"><shadow type="math_number" id="x(?#DpB,1j8XP.h8!`hS"><field name="NUM">255</field></shadow></value></block></value><value name="blue"><shadow type="math_number"><field name="NUM">255</field></shadow><block type="device_random" id=";e%ol~OPy]gfrCd#.9sS"><value name="min"><shadow type="math_number" id="z!I[G7%oA*HL~+.uxy3`"><field name="NUM">0</field></shadow></value><value name="limit"><shadow type="math_number" id="^*Am]ja=~C:4;(^MNw#["><field name="NUM">255</field></shadow></value></block></value></block></value><next><block type="variables_change" id="vl4{#xvO$?;Fq$Gw_rk("><field name="VAR" id="2FjMm]i},:,E@CE3kGS)">pixelsLit</field><value name="VALUE"><shadow type="math_number" id="Dje%)b5In5,mo*2r2=B)"><field name="NUM">1</field></shadow></value></block></next></block></statement><next><block type="controls_if" id="1K8`Cn%GDY?~X`2MYC0g"><value name="IF0"><shadow type="logic_boolean"><field name="BOOL">TRUE</field></shadow><block type="logic_compare" id="3.RjDcL)n#Pe9VrB:;6("><field name="OP">LT</field><value name="A"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id=")yPIo[hLZ8UmC%kcY9:8"><field name="VAR" id="tY}aip5xv8BkrOl(Ml=*">ledsToLight</field></block></value><value name="B"><shadow type="math_number"><field name="NUM">64</field></shadow><block type="variables_get" id="aYWFBq2mA83c}!,dK?]v"><field name="VAR" id="2FjMm]i},:,E@CE3kGS)">pixelsLit</field></block></value></block></value><statement name="DO0"><block type="neopixel_set_pixel_color" id="$a{HGvPG`Ia,?I{.p4Dr"><value name="strip"><block type="variables_get" id="KVcb{q)U5zoB|}BV{zS7"><field name="VAR" id="1tD53t7Nu6Gc-y@WFI0n">strip</field></block></value><value name="pixeloffset"><shadow type="math_number"><field name="NUM">0</field></shadow><block type="variables_get" id="_qTa{p)X!;MEje8!h9pn"><field name="VAR" id="2FjMm]i},:,E@CE3kGS)">pixelsLit</field></block></value><value name="rgb"><shadow type="neopixel_colors"><field name="color">NeoPixelColors.Black</field></shadow><block type="neopixel_rgb" id="/H/p^+(vH,[6n!O#0kn2"><value name="red"><shadow type="math_number" id="xD|82,`$X)(6?9TUiIuJ"><field name="NUM">0</field></shadow></value><value name="green"><shadow type="math_number" id="[z]E?W])lc9,Hq_Rx~C@"><field name="NUM">0</field></shadow></value><value name="blue"><shadow type="math_number" id="z7xm%~_cMVqp/dv]~R6%"><field name="NUM">0</field></shadow></value></block></value><next><block type="variables_change" id="V9FGZ,J)T%vY])L|)I;;"><field name="VAR" id="2FjMm]i},:,E@CE3kGS)">pixelsLit</field><value name="VALUE"><shadow type="math_number" id="C=LARB.FR=+@;`/.g8s/"><field name="NUM">-1</field></shadow></value></block></next></block></statement></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block></next></block></statement></block></xml>