1 line
3.2 KiB
XML
1 line
3.2 KiB
XML
<xml version="Mixly 2.0 Beta11" board="Arduino AVR@Arduino/Genuino Uno" xmlns="http://www.w3.org/1999/xhtml"><block type="factory_notes" id="1H={rIfpPxmalL?WL]JX" x="0" y="0"><field name="VALUE">D2:接按钮\nD9:接LED\n按下按钮可以控制LED开关切换,并且将开关状态存储到EEPROM中。\n每次重启时,先从EEPROM中读取灯在之前的状态,先将灯的状态恢复。\n即,如果主板在断电之前灯是开启状态的,主板重启后自动开灯。</field></block><block type="base_setup" id="PMT~jGHe-HkYOX7Y`ksT" x="0" y="145"><statement name="DO"><block type="variables_declare" id="%|Mp8=TI$_R1mE61o9j?"><field name="variables_type">global_variate</field><field name="VAR">state</field><field name="TYPE">boolean</field><value name="VALUE"><block type="logic_boolean" id="3huHD9-~G=u?TU:h(u-B"><field name="BOOL">FALSE</field></block></value><next><block type="variables_set" id="X9Osae=uf,fsE9GkkY4D"><field name="VAR">state</field><value name="VALUE"><block type="store_eeprom_read_byte" id="v6VX@/@#_W$Jb!80+n-T"><value name="ADDRESS"><shadow type="math_number" id="!;YYf2L]CVq^hT@^2e0."><field name="NUM">0</field></shadow></value></block></value><next><block type="inout_digital_write2" id="2LeMMT0)zX))[Mz}]wNz"><value name="PIN"><shadow type="pins_digital" id="y;X3*H6A?^7rAsbyrCt}"><field name="PIN">9</field></shadow></value><value name="STAT"><shadow xmlns="http://www.w3.org/1999/xhtml" type="inout_highlow" id="bNq*YB1O@WX)Ukb4/#7s"><field name="BOOL">HIGH</field></shadow><block type="variables_get" id="a+OZMuEehV%itKhRxDD7"><field name="VAR">state</field></block></value></block></next></block></next></block></statement></block><block type="OneButton_interrupt" id="twH-O}%KuQE$J0/.FA01" x="0" y="300"><field name="mode">attachClick</field><value name="PIN"><shadow type="pins_digital" id="N__5Yx}(otfh;}_v5%.G"><field name="PIN">2</field></shadow></value><value name="STAT"><shadow type="inout_highlow" id="z/.;|3ged9m]ZINJ;y=m"><field name="BOOL">LOW</field></shadow></value><statement name="DO"><block type="variables_set" id="DQUHtZrMdhi0$cTw4K]R"><field name="VAR">state</field><value name="VALUE"><block type="logic_negate" id="?!^lJL*y)=xY+]aRS0/|"><value name="BOOL"><block type="variables_get" id="zzU}82;nQ`jOmk;jV(=Z"><field name="VAR">state</field></block></value></block></value><next><block type="inout_digital_write2" id=":c$}_rqmbIpEvLU)a=LU"><value name="PIN"><shadow type="pins_digital" id="ePhj;]eG0nI.CÐ_552"><field name="PIN">9</field></shadow></value><value name="STAT"><shadow xmlns="http://www.w3.org/1999/xhtml" type="inout_highlow" id="bNq*YB1O@WX)Ukb4/#7s"><field name="BOOL">HIGH</field></shadow><block type="variables_get" id="kVkPC?oxO.C=R3$pH64*"><field name="VAR">state</field></block></value><next><block type="store_eeprom_write_byte" id="(#Av+Pp/mfHCCRg:#cS4"><value name="ADDRESS"><shadow type="math_number" id="F.=lc8BIIp;XZ~Ke)`;;"><field name="NUM">0</field></shadow></value><value name="DATA"><shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="~Z}X0QA!)DEkJ0a_UN;V"><field name="NUM">0</field></shadow><block type="variables_get" id="741GXYuLb7fHQHqNv,K="><field name="VAR">state</field></block></value></block></next></block></next></block></statement></block></xml> |