Files
mixly3/boards/default/micropython_esp32c2/examples/MixGo MINI/教学指南米思齐修订版/八年级代码/20-2 模拟补光.mix
2025-04-02 18:29:32 +08:00

1 line
4.6 KiB
XML

<xml version="Mixly 3.0 rc0" board="Python ESP32-C2@MixGo MINI" shown="block"><block type="variables_set" id="fz5*WaHfA-R?eN3hAE+E" x="-787" y="-501"><field name="VAR">light_min</field><value name="VALUE"><block type="math_number" id="CXEz1TCq=FFN=vrdZzxi"><field name="NUM">100</field></block></value><next><block type="variables_set" id="fjh[cbKo.mtG~(.1Oz9F"><field name="VAR">light_max</field><value name="VALUE"><block type="math_number" id="1]Rt~?,wDGB@Ne$zN.w/"><field name="NUM">250</field></block></value><next><block type="variables_set" id="IW+s[lpN8$qKG7Ny_X-["><field name="VAR">light_now</field><value name="VALUE"><block type="math_number" id="_Yz{,YH4GM25=TIirWth"><field name="NUM">0</field></block></value><next><block type="variables_set" id="l!6ISI(JPA(hj+fE2h4G"><field name="VAR">lightset</field><value name="VALUE"><block type="math_number" id="bWG2fU/.j}QeiO7[;jK_"><field name="NUM">0</field></block></value><next><block type="controls_whileUntil" id="l[akVjP|M@.249g7MMUq"><field name="MODE">WHILE</field><value name="BOOL"><shadow type="logic_boolean" id="0t8[?jF_dKP7*FV*~N9W"><field name="BOOL">TRUE</field></shadow></value><statement name="DO"><block type="variables_set" id="eeJl6KmLIWAY)cV=l79*"><field name="VAR">light_now</field><value name="VALUE"><block type="sensor_LTR308" id="jz[7GbehcvIcBHTmsqUT"></block></value><next><block type="system_print" id="ZOzF_NkGb^A0~KI~c*dN"><value name="VAR"><shadow type="text" id="hF.2#,tx`lItT=Ud@c4k"><field name="TEXT">Mixly</field></shadow><block type="variables_get" id="E@mWd0aK`nZ|D|64k[8M"><field name="VAR">light_now</field></block></value><next><block type="controls_if" id="d=KU-Y7=rl8kW@6le3XK"><mutation elseif="1" else="1"></mutation><value name="IF0"><block type="logic_compare" id="J{QLZ1+v(0YqeneH!rZ-"><field name="OP">GT</field><value name="A"><block type="variables_get" id="iSW?oR!iq}:vx1xX.gcK"><field name="VAR">light_now</field></block></value><value name="B"><block type="variables_get" id="zo:h5kD+_W+Xiy:JY,bO"><field name="VAR">light_max</field></block></value></block></value><statement name="DO0"><block type="math_selfcalcu" id="[=U3?#PG|Ekx4s^.yY]6"><field name="OP">MINUS</field><value name="A"><shadow type="variables_get" id="Dpg2cGZkVxy|FN(ZVbzF"><field name="VAR">lightset</field></shadow></value><value name="B"><shadow type="math_number" id="?,r+o)NnePjeh@lWQmY0"><field name="NUM">1</field></shadow></value></block></statement><value name="IF1"><block type="logic_compare" id="d2Gk8IeaQHU8yH6dwG=j"><field name="OP">LT</field><value name="A"><block type="variables_get" id="]gOZoH]$_Kx[IZq5n/L."><field name="VAR">light_now</field></block></value><value name="B"><block type="variables_get" id="H@dg~R)6YNy.xjNYIy{/"><field name="VAR">light_min</field></block></value></block></value><statement name="DO1"><block type="math_selfcalcu" id="(8;B-.shyBE]VkNj5QrH"><field name="OP">ADD</field><value name="A"><shadow type="variables_get" id="ux1TC^KGWQq*L3v,0=+t"><field name="VAR">lightset</field></shadow></value><value name="B"><shadow type="math_number" id="w|J|Y*UD_-?N]rZd)](O"><field name="NUM">1</field></shadow></value></block></statement><next><block type="actuator_onboard_neopixel_rgb_all" id="jrz)=qByE86RWbi-qu{!"><value name="RVALUE"><shadow type="math_number" id="WhFu-9$f+[3{6!]ID09k"><field name="NUM">0</field></shadow><block type="variables_get" id="|s*q~^;XhVNAB1b/w43B"><field name="VAR">lightset</field></block></value><value name="GVALUE"><shadow type="math_number" id="^h$QAY:F;jo=NZZoU#oa"><field name="NUM">0</field></shadow><block type="variables_get" id="k~)`6$w)@~KM-!S1Oi08"><field name="VAR">lightset</field></block></value><value name="BVALUE"><shadow type="math_number" id="aW|KF2pz3tzLQA:/Q}?G"><field name="NUM">0</field></shadow><block type="variables_get" id="76K9fBnsErf9tJ1ZFP$$"><field name="VAR">lightset</field></block></value><next><block type="actuator_onboard_neopixel_write" id="El+(SUHrb4@Ge+Ed*;-m"></block></next></block></next></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block></xml><config>{}</config><code>ZnJvbSBtaXhnb19taW5pIGltcG9ydCBvbmJvYXJkX2FscwppbXBvcnQgbWFjaGluZQpmcm9tIG1peGdvX21pbmkgaW1wb3J0IG9uYm9hcmRfcmdiCgoKbGlnaHRfbWluID0gMTAwCmxpZ2h0X21heCA9IDI1MApsaWdodF9ub3cgPSAwCmxpZ2h0c2V0ID0gMAp3aGlsZSBUcnVlOgogICAgbGlnaHRfbm93ID0gb25ib2FyZF9hbHMuYWxzX3ZpcygpCiAgICBwcmludChsaWdodF9ub3cpCiAgICBpZiBsaWdodF9ub3cgPiBsaWdodF9tYXg6CiAgICAgICAgbGlnaHRzZXQgLT0gMQogICAgZWxpZiBsaWdodF9ub3cgPCBsaWdodF9taW46CiAgICAgICAgbGlnaHRzZXQgKz0gMQogICAgZWxzZToKICAgICAgICBwYXNzCiAgICBvbmJvYXJkX3JnYi5maWxsKChsaWdodHNldCwgbGlnaHRzZXQsIGxpZ2h0c2V0KSkKICAgIG9uYm9hcmRfcmdiLndyaXRlKCkK</code>