This repository has been archived by the owner on Jul 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ArduinoBot.xml
12 lines (12 loc) · 1.59 KB
/
ArduinoBot.xml
1
2
<blocks app="Snap4Arduino 1.2.4
, http://snap4arduino.rocks" version="1"><block-definition s="run ecraft2learn command %'function name' %'inputs'" type="command" category="other"><header></header><code></code><inputs><input type="%txt"></input><input type="%mult%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>function_name</l><l>parameters</l></list><l>if (typeof ecraft2learn === 'object') {



 ecraft2learn.run(function_name, parameters);



} else {



 var script = document.createElement("script");



 script.type = "text/javascript";



 script.src = "https://toontalk.github.io/ai-cloud/ecraft2learn-dev.js";



 script.addEventListener('load', function () {



 ecraft2learn.run(function_name, parameters);



 });



 document.head.appendChild(script);



}</l></block><list><block var="function name"/><block var="inputs"/></list></block></script></block-definition><block-definition s="Send blocks to Arduino %'blocks'" type="command" category="other"><header></header><code></code><inputs><input type="%cmdRing"></input></inputs><script><block s="doRun"><block s="reifyScript"><script><custom-block s="run ecraft2learn command %txt %mult%s"><l>transpile_to_arduino_sketch</l><list><block var="blocks"/></list></custom-block></script><list></list></block><list><block var="blocks"/></list></block></script></block-definition></blocks>