turtlestitch/libraries/signada.xml

1 wiersz
15 KiB
XML

<blocks app="Snap! 7dev, https://snap.berkeley.edu" version="2"><block-definition s="🤖 connect to %&apos;ip&apos;" type="command" category="other"><header></header><code></code><translations>ca:🤖 connecta&apos;t a _&#xD;</translations><inputs><input type="%s">192.168.4.1</input></inputs><script><block s="doApplyExtension"><l>src_load(url)</l><list><l>libraries/signada.js</l></list></block><custom-block s="🤖 disconnect"></custom-block><block s="doApplyExtension"><l>sgd_connect(ip)</l><list><block var="ip"/></list></block></script></block-definition><block-definition s="🤖 disconnect" type="command" category="other"><header></header><code></code><translations>ca:🤖 desconnecta&apos;t&#xD;</translations><inputs></inputs><script><block s="doIf"><custom-block s="🤖 connected"></custom-block><script><block s="doApplyExtension"><l>sgd_disconnect()</l><list><l></l></list></block></script></block></script></block-definition><block-definition s="🤖 connected" type="predicate" category="other"><header></header><code></code><translations>ca:🤖 connectat&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>sgd_connected()</l><list></list></block></block></script></block-definition><block-definition s="play note %&apos;notename&apos; octave %&apos;octave&apos; for %&apos;ms&apos; ms" type="command" category="sound"><header></header><code></code><translations>ca:toca la nota _ a l&apos;octava _ durant _ ms&#xD;</translations><inputs><input type="%txt">C<options>C&#xD;C#&#xD;D&#xD;D#&#xD;E&#xD;F&#xD;F#&#xD;G&#xD;G#&#xD;A&#xD;A#&#xD;B</options></input><input type="%n">1<options>1&#xD;2&#xD;3&#xD;4&#xD;5</options></input><input type="%n">100</input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>play tone</l><block s="reportNewList"><list><block var="notename"/><block var="octave"/><block var="ms"/></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="button %&apos;buttonname&apos;" type="predicate" category="sensing"><header></header><code></code><translations>ca:botó _&#xD;</translations><inputs><input type="%s" readonly="true"><options>🆗&#xD;&#xD;➡️&#xD;⬆️&#xD;⬇️&#xD;⬅️</options></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><block s="reportJoinWords"><list><block s="reportListItem"><block s="reportListIndex"><block var="buttonname"/><block s="reportNewList"><list><l>🆗</l><l></l><l>➡️</l><l>⬆️</l><l>⬇️</l><l>⬅️</l></list></block></block><block s="reportNewList"><list><l>OK</l><l>cancel</l><l>right</l><l>up</l><l>down</l><l>left</l></list></block></block><l> button</l></list></block><l></l><block s="reportBoolean"><l><bool>false</bool></l></block></list></block></block></script></block-definition><block-definition s="set LED display $nl %&apos;i1&apos; %&apos;i2&apos; %&apos;i3&apos; %&apos;i4&apos; %&apos;i5&apos; $nl %&apos;i6&apos; %&apos;i7&apos; %&apos;i8&apos; %&apos;i9&apos; %&apos;i10&apos; $nl %&apos;i11&apos; %&apos;i12&apos; %&apos;i13&apos; %&apos;i14&apos; %&apos;i15&apos; $nl %&apos;i16&apos; %&apos;i17&apos; %&apos;i18&apos; %&apos;i19&apos; %&apos;i20&apos; $nl %&apos;i21&apos; %&apos;i22&apos; %&apos;i23&apos; %&apos;i24&apos; %&apos;i25&apos;" type="command" category="pen"><header></header><code></code><translations>ca:dibuixa a la pantalla _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _&#xD;</translations><inputs><input type="%b">false</input><input type="%b">false</input><input type="%b">false</input><input type="%b">false</input><input type="%b">false</input><input type="%b">false</input><input type="%b">true</input><input type="%b">false</input><input type="%b">true</input><input type="%b">false</input><input type="%b">false</input><input type="%b">false</input><input type="%b">false</input><input type="%b">false</input><input type="%b">false</input><input type="%b">true</input><input type="%b">false</input><input type="%b">false</input><input type="%b">false</input><input type="%b">true</input><input type="%b">false</input><input type="%b">true</input><input type="%b">true</input><input type="%b">true</input><input type="%b">false</input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>set display</l><block s="reportNewList"><list><block s="reportJoinWords"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportIfElse"><l/><l>X</l><l>O</l></block></autolambda><list></list></block><block s="reportNewList"><list><block var="i1"/><block var="i2"/><block var="i3"/><block var="i4"/><block var="i5"/><block var="i6"/><block var="i7"/><block var="i8"/><block var="i9"/><block var="i10"/><block var="i11"/><block var="i12"/><block var="i13"/><block var="i14"/><block var="i15"/><block var="i16"/><block var="i17"/><block var="i18"/><block var="i19"/><block var="i20"/><block var="i21"/><block var="i22"/><block var="i23"/><block var="i24"/><block var="i25"/></list></block></block></block></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="move motor %&apos;n&apos; %&apos;steps&apos; steps %&apos;direction&apos;" type="command" category="motion"><header></header><code></code><translations>ca:mou motor _ _ passos _&#xD;</translations><inputs><input type="%n">1</input><input type="%n">128</input><input type="%txt" readonly="true">clockwise<options>clockwise&#xD;counter-clockwise</options></input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>motor step</l><block s="reportNewList"><list><block var="n"/><block var="steps"/><block var="direction"/></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="move motor 1 %&apos;direction&apos; and motor 2 %&apos;direction-2&apos; %&apos;steps&apos; steps" type="command" category="motion"><header></header><code></code><translations>ca:mou motor 1 en _ motor 2 en _ _ passos&#xD;</translations><inputs><input type="%s" readonly="true">clockwise<options>clockwise&#xD;counter-clockwise</options></input><input type="%s" readonly="true">counter-clockwise<options>clockwise&#xD;counter-clockwise</options></input><input type="%n">64</input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>move motor </l><block s="reportNewList"><list><block var="direction"/><block var="direction-2"/><block var="steps"/></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="move motor %&apos;n&apos; angle %&apos;angle&apos; °" type="command" category="motion"><header></header><code></code><translations>ca:mou motor _ angle _ °&#xD;</translations><inputs><input type="%n">1</input><input type="%n">-90</input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>motor angle</l><block s="reportNewList"><list><block var="n"/><block var="angle"/></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="move motor %&apos;n&apos; %&apos;turns&apos; complete turns" type="command" category="motion"><header></header><code></code><translations>ca:mou motor _ _ voltes completes&#xD;</translations><inputs><input type="%n">1</input><input type="%n">3</input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>motor turns</l><block s="reportNewList"><list><block var="n"/><block var="turns"/></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="write %&apos;text&apos; at x: %&apos;x&apos; y: %&apos;y&apos; color %&apos;clr&apos; scale %&apos;scale&apos;" type="command" category="pen"><header></header><code></code><translations>ca:escriu _ a x: _ y: _ color _ escala _&#xD;</translations><inputs><input type="%s">Hello, MicroBlocks!</input><input type="%n">10</input><input type="%n">30</input><input type="%s" readonly="true">🔵<options>🔵&#xD;🟢&#xD;​🔴&#xD;​🟣&#xD;​🟡&#xD;​⚪️</options></input><input type="%n">1</input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>text</l><block s="reportNewList"><list><block var="text"/><block var="x"/><block var="y"/><block s="reportListItem"><block s="reportIfElse"><block s="reportEquals"><block var="clr"/><l></l></block><l>1</l><block s="reportListIndex"><block var="clr"/><block s="reportNewList"><list><l>🔵</l><l>🟢</l><l>​🔴</l><l>​🟣</l><l>​🟡</l><l>​⚪️</l></list></block></block></block><block s="reportNewList"><list><l>255</l><l>65280</l><l>16711680</l><l>16711935</l><l>16776960</l><l>16777215</l></list></block></block><block var="scale"/><l>0</l></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="clear display" type="command" category="pen"><header></header><code></code><translations>ca:neteja pantalla&#xD;</translations><inputs></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>clear</l><l></l><l></l></list></block></block></script></block-definition><block-definition s="set LED x: %&apos;x&apos; y: %&apos;y&apos; to %&apos;bool&apos;" type="command" category="pen"><header></header><code></code><translations>ca:posa el LED x: _ y: _ a _&#xD;</translations><inputs><input type="%n">3</input><input type="%n">3</input><input type="%b">true</input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>set led</l><block s="reportNewList"><list><block var="x"/><block var="y"/><block var="bool"/></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="display character %&apos;char&apos;" type="command" category="pen"><header></header><code></code><translations>ca:mostra caràcter _&#xD;</translations><inputs><input type="%s">A</input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>displayCharacter</l><block s="reportNewList"><list><block var="char"/></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="set digital pin %&apos;pin&apos; to %&apos;bool&apos;" type="command" category="sensing"><header></header><code></code><translations>ca:posa el pin digital _ a _&#xD;</translations><inputs><input type="%n">1</input><input type="%b">true</input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>set pin</l><block s="reportNewList"><list><block var="pin"/><l>digital</l><block var="bool"/></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="set analog pin %&apos;pin&apos; to %&apos;value&apos;" type="command" category="sensing"><header></header><code></code><translations>ca:posa el pin analògic _ a _&#xD;</translations><inputs><input type="%n">1</input><input type="%n">512</input></inputs><script><block s="doDeclareVariables"><list><l>a</l></list></block><block s="doSetVar"><l>a</l><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>set pin</l><block s="reportNewList"><list><block var="pin"/><l>analog</l><block var="value"/></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="read digital pin %&apos;pin&apos;" type="predicate" category="sensing"><header></header><code></code><translations>ca:llegeix el pin digital _&#xD;</translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>get pin</l><block s="reportNewList"><list><block var="pin"/><l>digital</l></list></block><block s="reportBoolean"><l><bool>false</bool></l></block></list></block></block></script></block-definition><block-definition s="read analog pin %&apos;pin&apos;" type="reporter" category="sensing"><header></header><code></code><translations>ca:llegeix el pin analògic _&#xD;</translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>get pin</l><block s="reportNewList"><list><block var="pin"/><l>analog</l></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="tilt %&apos;axis&apos;" type="reporter" category="sensing"><header></header><code></code><translations>ca:inclinació _&#xD;</translations><inputs><input type="%s" readonly="true">x<options>x&#xD;y&#xD;z</options></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>tilt</l><block s="reportNewList"><list><block var="axis"/></list></block><l>0</l></list></block></block></script></block-definition><block-definition s="acceleration" type="reporter" category="sensing"><variables><list struct="atomic" id="456">memoized response,calling</list></variables><header></header><code></code><translations>ca:acceleració&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>sensor</l><block s="reportNewList"><list><l>acceleration</l></list></block><l>100</l></list></block></block></script></block-definition><block-definition s="light level" type="reporter" category="sensing"><header></header><code></code><translations>ca:nivell de llum&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>sensor</l><block s="reportNewList"><list><l>light</l></list></block><l>100</l></list></block></block></script></block-definition><block-definition s="temperature °C" type="reporter" category="sensing"><header></header><code></code><translations>ca:temperatura °C&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>sgd_call(blockname, params, defaultresponse)</l><list><l>sensor</l><block s="reportNewList"><list><l>temperature</l></list></block><l>20</l></list></block></block></script></block-definition></blocks>