Files
mixly3/boards/default/arduino_avr/examples/02-控制/09-硬件中断-秒表.mix
2024-07-19 10:16:00 +08:00

1 line
3.8 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<xml version="Mixly 2.0 Beta11" board="Arduino AVR@Arduino/Genuino Uno" xmlns="http://www.w3.org/1999/xhtml"><block type="base_setup" id="azT8VQ]1k58TQS^AdZAb" x="-34" y="-72"><statement name="DO"><block type="factory_notes" id="fOlu_DE)v*cJ#04KC)-U"><field name="VALUE">秒表\n按钮传感器连接到D2\n第一次按下按钮开始计时再次按下按钮停止计时\n并通过串口监视器输出时间值</field><next><block type="serial_begin" id="D%EggaJ+A,ipXh.AeNpR"><field name="serial_select">Serial</field><value name="CONTENT"><shadow type="math_number" id="=@X{WaY_UjaV;[mq~noj"><field name="NUM">9600</field></shadow></value><next><block type="variables_declare" id="aE:G4*UURW=}l8}QBW~)"><field name="variables_type">global_variate</field><field name="VAR">startTime</field><field name="TYPE">int</field><next><block type="variables_declare" id="L|wl@VjLO!SpAA!FvqqW"><field name="variables_type">global_variate</field><field name="VAR">endTime</field><field name="TYPE">int</field><next><block type="variables_declare" id="zRFVDSU$jSmm)o5X5q.5"><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="o`o$F$^bL93xFj!!/)LE"><field name="BOOL">FALSE</field></block></value><next><block type="controls_attachInterrupt" id="{oOQZfPv{9_=NaeC8-/Y"><field name="mode">RISING</field><value name="PIN"><shadow type="pins_interrupt" id="KkB5zh8DJ?2v)`GGdRU["><field name="PIN">2</field></shadow></value><statement name="DO"><block type="controls_if" id="x0}*fmYZmKu|z!RT*!4]"><mutation xmlns="http://www.w3.org/1999/xhtml" else="1"></mutation><value name="IF0"><block type="logic_compare" id="rX#fkA{kNKXxh,:wH#JK"><field name="OP">EQ</field><value name="A"><block type="variables_get" id="uE?`FN|!jc(O^k[%GH=w"><field name="VAR">state</field></block></value><value name="B"><block type="logic_boolean" id="tSRgm1b4-%o@(t[a3bsJ"><field name="BOOL">FALSE</field></block></value></block></value><statement name="DO0"><block type="variables_set" id="6^(w:BwrHmO5(`:y:+K."><field name="VAR">state</field><value name="VALUE"><block type="logic_boolean" id="|-p:?Op@t$(Ln6[$|gwP"><field name="BOOL">TRUE</field></block></value><next><block type="variables_set" id="@ck=nlybobPk^|AQSLjt"><field name="VAR">startTime</field><value name="VALUE"><block type="controls_millis" id="cd$`abbC))ZMi3m8NBVG"><field name="UNIT">millis</field></block></value></block></next></block></statement><statement name="ELSE"><block type="variables_set" id="6Y_dx:QK)BJHVV#RB{X/"><field name="VAR">state</field><value name="VALUE"><block type="logic_boolean" id="@T!c,!pbafFbA^TxT~fK"><field name="BOOL">FALSE</field></block></value><next><block type="variables_set" id="xbc^t;GTC[Ph+EKWM]18"><field name="VAR">endTime</field><value name="VALUE"><block type="controls_millis" id="t@rrVKp^/tr*E[?+a}vR"><field name="UNIT">millis</field></block></value><next><block type="serial_println" id="323*=o2jfFHRH::nm8.J"><field name="serial_select">Serial</field><field name="new_line">println</field><value name="CONTENT"><block type="math_arithmetic" id="8x{(XkXd@Z:h$ebhq)Fy"><field name="OP">MINUS</field><value name="A"><shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="B!_OK+JYozA7Ww5kE!XZ"><field name="NUM">1</field></shadow><block type="variables_get" id="{QjI`y=F,-jyCN%Xgrlv"><field name="VAR">endTime</field></block></value><value name="B"><shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="!!Lx%~/I@S]1qwv9Im[I"><field name="NUM">1</field></shadow><block type="variables_get" id="m]f=KMgOJ-uKRbWw5qj3"><field name="VAR">startTime</field></block></value></block></value></block></next></block></next></block></statement></block></statement></block></next></block></next></block></next></block></next></block></next></block></statement></block></xml>