Progetto

Generale

Profilo

File » DrawingRobot_1.1.1.beta.xml

Andrea Cimini, 13-12-2015 00:35

 
1
<project name="DrawingRobot" app="Snap4Arduino 1.0.6 beta http://s4a.cat/snap" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAADVUlEQVR4Xu3VsUllYRSF0V9QjE2MbMBAI8HAyCq0BRFMLcEibMQabMMuRHTGlzkM4zuwZQezbnzeObDex707H7+f5SFQEtgRYEne2Y2AAIVQFRBgld9xAWqgKiDAKr/jAtRAVUCAVX7HBaiBqoAAq/yOC1ADVQEBVvkdF6AGqgICrPI7LkANVAUEWOV3XIAaqAoIsMrvuAA1UBUQYJXfcQFqoCogwCq/4wLUQFVAgFV+xwWogaqAAKv8jgtQA1UBAVb5HRegBqoCAqzyOy5ADVQFBFjld1yAGqgKCLDK77gANVAVEGCV33EBaqAqIMAqv+MC1EBVQIBVfscFqIGqgACr/I4LUANVAQFW+R0XoAaqAgKs8jsuQA1UBQRY5XdcgBqoCgiwyu+4ADVQFRBgld9xAWqgKiDAKr/jAtRAVUCAVX7HBaiBqoAAq/yOC1ADVQEBVvkdF+A3DTw9Pa3z8/N1cHCglh8QEOA3qC8vL+vu7m59fHys/f39dX9/v05OTtbe3t4P/B3/30oBbvGfPz8/r4eHhy+Tr6+v6+zsbF1fX6/j4+Mtthj5m4AAt+ji7e1tXV1drff39y/Tn2/F3d3dzef58fFxi01G/hQQ4BZNXFxcrMPDw83k55vv6Oho3d7ertPT0y1+beRfAgL8po+bm5vNm+/y8nLzufVkBQSY9bRtKCDAIZjxrIAAs562DQUEOAQznhUQYNbTtqGAAIdgxrMCAsx62jYUEOAQzHhWQIBZT9uGAgIcghnPCggw62nbUECAQzDjWQEBZj1tGwoIcAhmPCsgwKynbUMBAQ7BjGcFBJj1tG0oIMAhmPGsgACznrYNBQQ4BDOeFRBg1tO2oYAAh2DGswICzHraNhQQ4BDMeFZAgFlP24YCAhyCGc8KCDDradtQQIBDMONZAQFmPW0bCghwCGY8KyDArKdtQwEBDsGMZwUEmPW0bSggwCGY8ayAALOetg0FBDgEM54VEGDW07ahgACHYMazAgLMeto2FBDgEMx4VkCAWU/bhgICHIIZzwoIMOtp21BAgEMw41kBAWY9bRsKCHAIZjwrIMCsp21DAQEOwYxnBQSY9bRtKCDAIZjxrIAAs562DQUEOAQznhUQYNbTtqGAAIdgxrMCvwBRBwu3M8LehwAAAABJRU5ErkJggg==</thumbnail><stage name="Stage" width="480" height="360" costume="0" tempo="60" threadsafe="false" lines="round" codify="false" inheritance="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAOhUlEQVR4Xu3VwQkAAAjEMN1/abewn7jAQRC64wgQIECAAIF3gX1fNEiAAAECBAiMAHsCAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+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D7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQIHLFxAWmhEwHPAAAAAElFTkSuQmCC</pentrails><costumes><list id="2"></list></costumes><sounds><list id="3"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites><sprite name="Sprite" idx="1" x="5.724876020886768" y="-9.7077214690122" heading="90" scale="1" rotation="1" draggable="true" costume="0" color="80,80,80" pen="tip" id="8"><costumes><list id="9"></list></costumes><sounds><list id="10"></list></sounds><variables></variables><blocks></blocks><scripts><script x="30" y="10"><block s="receiveGo"></block><block s="doForever"><script><block s="digitalWrite"><l>13</l><block s="reportTrue"></block></block><block s="doWait"><l>1</l></block><block s="digitalWrite"><l>13</l><block s="reportFalse"></block></block><block s="doWait"><l>1</l></block></script></block></script><script x="17" y="181"><block s="receiveKey"><l><option>q</option></l></block><custom-block s="penup"></custom-block></script><script x="215" y="177"><block s="receiveKey"><l><option>a</option></l></block><custom-block s="pendown"></custom-block></script><script x="10" y="262"><block s="receiveKey"><l><option>up arrow</option></l></block><custom-block s="forward %s"><l>50</l></custom-block><custom-block s="done"></custom-block></script><script x="215" y="263"><block s="receiveKey"><l><option>down arrow</option></l></block><custom-block s="backward %s"><l>50</l></custom-block><custom-block s="done"></custom-block></script><script x="213" y="355"><block s="receiveKey"><l><option>right arrow</option></l></block><custom-block s="right %s"><l>30</l></custom-block><custom-block s="done"></custom-block></script><script x="15" y="361"><block s="receiveKey"><l><option>left arrow</option></l></block><custom-block s="left %s"><l>30</l></custom-block><custom-block s="done"></custom-block></script><script x="203" y="465"><block s="receiveKey"><l><option>space</option></l></block><custom-block s="init"></custom-block></script><script x="25" y="464"><block s="receiveKey"><l><option>9</option></l></block><custom-block s="testStepper"></custom-block></script><script x="607" y="83"><block s="receiveKey"><l><option>0</option></l></block><custom-block s="pendown"></custom-block><custom-block s="forward %s"><l>1000</l></custom-block><custom-block s="penup"></custom-block><custom-block s="done"></custom-block></script><script x="604" y="208"><block s="receiveKey"><l><option>t</option></l></block><custom-block s="OLD right %s"><l>30</l></custom-block><block s="doWait"><l>3</l></block><custom-block s="OLD right %s"><l>30</l></custom-block><block s="doWait"><l>3</l></block><custom-block s="OLD right %s"><l>30</l></custom-block><block s="doWait"><l>3</l></block><custom-block s="OLD right %s"><l>30</l></custom-block><block s="doWait"><l>3</l></block><custom-block s="OLD right %s"><l>30</l></custom-block><block s="doWait"><l>3</l></block><custom-block s="OLD right %s"><l>30</l></custom-block><block s="doWait"><l>3</l></block><custom-block s="done"></custom-block></script><script x="433" y="24"><block s="receiveKey"><l><option>h</option></l></block><custom-block s="pendown"></custom-block><custom-block s="left %s"><l>90</l></custom-block><custom-block s="forward %s"><l>100</l></custom-block><custom-block s="backward %s"><l>50</l></custom-block><custom-block s="right %s"><l>90</l></custom-block><custom-block s="forward %s"><l>50</l></custom-block><custom-block s="left %s"><l>90</l></custom-block><custom-block s="forward %s"><l>50</l></custom-block><custom-block s="backward %s"><l>100</l></custom-block><custom-block s="right %s"><l>90</l></custom-block><custom-block s="penup"></custom-block><custom-block s="forward %s"><l>25</l></custom-block><custom-block s="pendown"></custom-block><custom-block s="left %s"><l>90</l></custom-block><custom-block s="forward %s"><l>100</l></custom-block><custom-block s="right %s"><l>90</l></custom-block><custom-block s="forward %s"><l>50</l></custom-block><custom-block s="right %s"><l>90</l></custom-block><custom-block s="forward %s"><l>50</l></custom-block><custom-block s="right %s"><l>90</l></custom-block><custom-block s="forward %s"><l>50</l></custom-block><custom-block s="backward %s"><l>50</l></custom-block><custom-block s="left %s"><l>90</l></custom-block><custom-block s="forward %s"><l>50</l></custom-block><custom-block s="left %s"><l>90</l></custom-block><custom-block s="penup"></custom-block><custom-block s="forward %s"><l>25</l></custom-block></script></scripts></sprite></sprites></stage><hidden></hidden><headers></headers><code><delim>,</delim><tempvars_delim>,</tempvars_delim><string>&quot;&lt;#1&gt;&quot;</string><doWait>delay(&lt;#1&gt; * 1000);</doWait><doForever>void loop() {&#xD;  &lt;#1&gt;&#xD;}</doForever><doRepeat>for (int i = 0; i &lt; &lt;#1&gt;; i++) {&#xD;  &lt;#2&gt;&#xD;}</doRepeat><doIf>if (&lt;#1&gt;) {&#xD;  &lt;#2&gt;&#xD;}</doIf><doIfElse>if (&lt;#1&gt;) {&#xD;  &lt;#2&gt;&#xD;} else {&#xD;  &lt;#3&gt;&#xD;}</doIfElse><reportSum>(&lt;#1&gt; + &lt;#2&gt;)</reportSum><reportDifference>(&lt;#1&gt; - &lt;#2&gt;)</reportDifference><reportProduct>(&lt;#1&gt; * &lt;#2&gt;)</reportProduct><reportQuotient>(&lt;#1&gt; / &lt;#2&gt;)</reportQuotient><reportModulus>(&lt;#1&gt; % &lt;#2&gt;)</reportModulus><reportMonadic>&lt;#1&gt;(&lt;#2&gt;)</reportMonadic><reportRandom>random(&lt;#1&gt;, &lt;#2&gt;)</reportRandom><reportLessThan>(&lt;#1&gt; &lt; &lt;#2&gt;)</reportLessThan><reportEquals>(&lt;#1&gt; == &lt;#2&gt;)</reportEquals><reportGreaterThan>(&lt;#1&gt; &gt; &lt;#2&gt;)</reportGreaterThan><reportAnd>(&lt;#1&gt; &amp;&amp; &lt;#2&gt;)</reportAnd><reportOr>(&lt;#1&gt; || &lt;#2&gt;)</reportOr><reportNot>!(&lt;#1&gt;)</reportNot><reportTrue>true</reportTrue><reportFalse>false</reportFalse><doSetVar>&lt;#1&gt; = &lt;#2&gt;;</doSetVar><doChangeVar>&lt;#1&gt; += &lt;#2&gt;;</doChangeVar><doDeclareVariables>int &lt;#1&gt;;</doDeclareVariables><reportAnalogReading>analogRead(&lt;#1&gt;)</reportAnalogReading><reportDigitalReading>digitalRead(&lt;#1&gt;)</reportDigitalReading><setPinMode>pinMode(&lt;#1&gt;, &lt;#2&gt;);</setPinMode><digitalWrite>digitalWrite(&lt;#1&gt;, &lt;#2&gt;);</digitalWrite><servoWrite>servo&lt;#1&gt;.write(&lt;#2&gt;);</servoWrite><pwmWrite>analogWrite(&lt;#1&gt;, &lt;#2&gt;);</pwmWrite></code><blocks><block-definition s="done" type="command" category="arduino"><header></header><code></code><inputs></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l></l></list><l>var L_stepper_pins = [10, 12, 13, 11];&#xD;var R_stepper_pins = [3, 5, 6, 4];&#xD;for(pin = 0; pin &lt; 4; pin++ ) &#xD;{ &#xD; this.arduino.board.pinMode(L_stepper_pins[pin],this.arduino.board.MODES.OUTPUT); &#xD; this.arduino.board.digitalWrite(L_stepper_pins[pin], this.arduino.board.MODES.LOW); &#xD; this.arduino.board.pinMode(R_stepper_pins[pin],this.arduino.board.MODES.OUTPUT); &#xD; this.arduino.board.digitalWrite(R_stepper_pins[pin], this.arduino.board.MODES.LOW); &#xD;}</l></block><list></list></block></script></block-definition><block-definition s="penup" type="command" category="arduino"><header></header><code></code><inputs></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l></l></list><l>this.arduino.board.servoWrite(8,80);</l></block><list></list></block></script></block-definition><block-definition s="pendown" type="command" category="arduino"><header></header><code></code><inputs></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l></l></list><l>this.arduino.board.servoWrite(8,170)</l></block><list></list></block></script></block-definition><block-definition s="OLD forward %&apos;distance&apos;" type="command" category="arduino"><header></header><code></code><inputs><input type="%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>distance</l></list><l>var wheel_dia=64.5; &#xD;var wheel_base=114.5;&#xD;var steps_rev=512; &#xD;var delay_time=6; &#xD;var L_stepper_pins = [10, 12, 13, 11];&#xD;var R_stepper_pins = [3, 5, 6, 4]; &#xD;var fwd_mask =  [[1, 0, 1, 0], [0, 1, 1, 0], [0, 1, 0, 1], [1, 0, 0, 1]]; &#xD;var rev_mask =  [[1, 0, 0, 1], [0, 1, 0, 1], [0, 1, 1, 0], [1, 0, 1, 0]]; &#xD;var steps = distance * steps_rev / (wheel_dia * 3.1412);&#xD;for(step = 0; step &lt; steps; step++ ) { &#xD; for(mask = 0; mask &lt; 4; mask++ ) { &#xD; for(pin = 0; pin &lt; 4; pin++ ) { &#xD; this.arduino.board.digitalWrite(L_stepper_pins[pin], rev_mask[mask][pin]); &#xD; this.arduino.board.digitalWrite(R_stepper_pins[pin], fwd_mask[mask][pin]); &#xD; } &#xD; setTimeout(&apos;&apos;, delay_time); &#xD;} &#xD;}</l></block><list><block var="distance"/></list></block></script></block-definition><block-definition s="OLD backward %&apos;distance&apos;" type="command" category="arduino"><header></header><code></code><inputs><input type="%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>distance</l></list><l>var wheel_dia=64.5; &#xD;var wheel_base=114.5;&#xD;var steps_rev=512; &#xD;var delay_time=6; &#xD;var L_stepper_pins = [10, 12, 13, 11];&#xD;var R_stepper_pins = [3, 5, 6, 4]; &#xD;var fwd_mask =  [[1, 0, 1, 0], [0, 1, 1, 0], [0, 1, 0, 1], [1, 0, 0, 1]]; &#xD;var rev_mask =  [[1, 0, 0, 1], [0, 1, 0, 1], [0, 1, 1, 0], [1, 0, 1, 0]]; &#xD;var steps = distance * steps_rev / (wheel_dia * 3.1412);&#xD;for(step = 0; step &lt; steps; step++ ) { &#xD; for(mask = 0; mask &lt; 4; mask++ ) { &#xD; for(pin = 0; pin &lt; 4; pin++ ) { &#xD; this.arduino.board.digitalWrite(L_stepper_pins[pin], fwd_mask[mask][pin]); &#xD; this.arduino.board.digitalWrite(R_stepper_pins[pin], rev_mask[mask][pin]); &#xD; } &#xD; setTimeout(&apos;&apos;, delay_time); &#xD;} &#xD;}</l></block><list><block var="distance"/></list></block></script></block-definition><block-definition s="OLD right %&apos;degrees&apos;" type="command" category="arduino"><header></header><code></code><inputs><input type="%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>degrees</l></list><l>var wheel_dia=64.5; &#xD;var wheel_base=114.5;&#xD;var steps_rev=512; &#xD;var delay_time=6; &#xD;var L_stepper_pins = [10, 12, 13, 11];&#xD;var R_stepper_pins = [3, 5, 6, 4]; &#xD;var fwd_mask =  [[1, 0, 1, 0], [0, 1, 1, 0], [0, 1, 0, 1], [1, 0, 0, 1]]; &#xD;var rev_mask =  [[1, 0, 0, 1], [0, 1, 0, 1], [0, 1, 1, 0], [1, 0, 1, 0]]; &#xD;var rotation = degrees / 360;&#xD;var distance = wheel_base * 3.1412 * rotation;&#xD;var steps = distance * steps_rev / (wheel_dia * 3.1412);&#xD;for(step = 0; step &lt; steps; step++ ) { &#xD; for(mask = 0; mask &lt; 4; mask++ ) { &#xD; for(pin = 0; pin &lt; 4; pin++ ) { &#xD; this.arduino.board.digitalWrite(R_stepper_pins[pin], rev_mask[mask][pin]); &#xD; this.arduino.board.digitalWrite(L_stepper_pins[pin], rev_mask[mask][pin]); &#xD; } &#xD; setTimeout(&apos;&apos;, delay_time); &#xD;} &#xD;}</l></block><list><block var="degrees"/></list></block></script></block-definition><block-definition s="OLD left %&apos;degrees&apos;" type="command" category="arduino"><header></header><code></code><inputs><input type="%s"></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>degrees</l></list><l>var wheel_dia=64.5; &#xD;var wheel_base=114.5;&#xD;var steps_rev=512; &#xD;var delay_time=6; &#xD;var L_stepper_pins = [10, 12, 13, 11];&#xD;var R_stepper_pins = [3, 5, 6, 4]; &#xD;var fwd_mask =  [[1, 0, 1, 0], [0, 1, 1, 0], [0, 1, 0, 1], [1, 0, 0, 1]]; &#xD;var rev_mask =  [[1, 0, 0, 1], [0, 1, 0, 1], [0, 1, 1, 0], [1, 0, 1, 0]]; &#xD;var rotation = degrees / 360;&#xD;var distance = wheel_base * 3.1412 * rotation;&#xD;var steps = distance * steps_rev / (wheel_dia * 3.1412);&#xD;for(step = 0; step &lt; steps; step++ ) { &#xD; for(mask = 0; mask &lt; 4; mask++ ) { &#xD; for(pin = 0; pin &lt; 4; pin++ ) { &#xD; this.arduino.board.digitalWrite(R_stepper_pins[pin], fwd_mask[mask][pin]); &#xD; this.arduino.board.digitalWrite(L_stepper_pins[pin], fwd_mask[mask][pin]); &#xD; } &#xD; setTimeout(&apos;&apos;, delay_time); &#xD;} &#xD;}</l></block><list><block var="degrees"/></list></block></script></block-definition><block-definition s="testStepper" type="command" category="arduino"><header></header><code></code><inputs></inputs><script><block s="doDeclareVariables"><list><l>done</l></list></block><block s="doSetVar"><l>done</l><block s="reportNewList"><list><l></l></list></block></block><block s="doRun"><block s="reportJSFunction"><list><l>done</l></list><l>	// private static constants
2
&#xD;								var STEPPER = 0x72								
3
&#xD;								CONFIG = 0,								
4
&#xD;								STEP = 1,
5
&#xD;								DRV_4WIRE = 0x04,
6
&#xD;								MAX_STEPS = 2097151, // 21 bits (2^21 - 1) 
7
&#xD;								MAX_SPEED = 16383, // 14 bits (2^14 - 1)
8
&#xD;								stepper1_directionPin = 3,
9
&#xD;								stepper1_stepPin = 5,
10
&#xD;								stepper1_motorPin3 = 6,
11
&#xD;								stepper1_motorPin4 = 4,	
12
&#xD;								stepper2_directionPin = 10,
13
&#xD;								stepper2_stepPin = 12,
14
&#xD;								stepper2_motorPin3 = 13,
15
&#xD;								stepper2_motorPin4 = 11,	
16
&#xD;								CLOCKWISE = 0,
17
&#xD;								COUNTER_CLOCKWISE = 1;&#xD;
18
								
19
&#xD;								var numStepsPerRev = 64;&#xD;								var numStepsPerRevLSB = numStepsPerRev &amp; 0x007F,&#xD;
20
							numStepsPerRevMSB = (numStepsPerRev &gt;&gt; 7) &amp; 0x007F;&#xD;
21
&#xD;								var numSteps = 1050; //3700 x 1 giro di 360°&#xD;								var steps = [
22
&#xD;									Math.abs(numSteps) &amp; 0x0000007F,&#xD; 								(Math.abs(numSteps) &gt;&gt; 7) &amp; 0x0000007F,&#xD;									(Math.abs(numSteps) &gt;&gt; 14) &amp; 0x0000007F&#xD;								];&#xD;
23
&#xD;        var speed = 30; //(1-50)
24
&#xD;								speed = Math.floor(speed.toFixed(2) * 100);&#xD;
25
							var speedLSB = speed &amp; 0x007F;&#xD;								var speedMSB = (speed &gt;&gt; 7) &amp; 0x007F;&#xD;								
26
&#xD;								//this.arduino.board.pinMode(directionPin, this.arduino.board.MODES.OUTPUT);
27
&#xD;								//this.arduino.board.pinMode(stepPin, this.arduino.board.MODES.OUTPUT);&#xD;
28
							//this.arduino.board.pinMode(motorPin3, this.arduino.board.MODES.OUTPUT);&#xD;								//this.arduino.board.pinMode(motorPin4, this.arduino.board.MODES.OUTPUT);								&#xD;
29
&#xD;								//this.arduino.board.sp.write(new Buffer([0xF0,STEPPER,CONFIG,0,DRV_4WIRE,numStepsPerRevLSB,numStepsPerRevMSB,stepper1_directionPin,stepper1_stepPin,stepper1_motorPin3,stepper1_motorPin4,0xF7])); 
30
&#xD;        //this.arduino.board.sp.write(new Buffer([0xF0,STEPPER,CONFIG,1,DRV_4WIRE,numStepsPerRevLSB,numStepsPerRevMSB,stepper2_directionPin,stepper2_stepPin,stepper2_motorPin3,stepper2_motorPin4,0xF7]));&#xD;  
31
					//this.arduino.board.sp.write(new Buffer([0xF0,STEPPER,STEP,0,COUNTER_CLOCKWISE,steps[0],steps[1],steps[2],speedLSB,speedMSB,0xF7]));&#xD; 
32
						//this.arduino.board.sp.write(new Buffer([0xF0,STEPPER,STEP,1,CLOCKWISE,steps[0],steps[1],steps[2],speedLSB,speedMSB,0xF7]));&#xD;        &#xD;        var index = 0;&#xD;&#xD;        var doneCallback0 = function () {&#xD;           done.add(++index);&#xD;        }&#xD;&#xD;        var doneCallback1 = function () {&#xD;           done.add(++index);&#xD;        }&#xD;        &#xD;        //this.arduino.board.stepperConfig(0, DRV_4WIRE, 64, stepper1_directionPin, stepper1_stepPin, stepper1_motorPin3, stepper1_motorPin4);&#xD;        //this.arduino.board.stepperConfig(1, DRV_4WIRE, 64, stepper2_directionPin, stepper2_stepPin, stepper2_motorPin3, stepper2_motorPin4);        &#xD;&#xD;        this.arduino.board.stepperStep(0, CLOCKWISE, 1000, 4000, doneCallback0);					&#xD;        this.arduino.board.stepperStep(1, CLOCKWISE, 1000, 4000, doneCallback1);
33
&#xD;								</l></block><list><block var="done"/></list></block><block s="doWaitUntil"><block s="reportEquals"><block s="reportListItem"><l><option>last</option></l><block var="done"/></block><l>2</l></block></block></script></block-definition><block-definition s="init" type="command" category="arduino"><header></header><code></code><inputs></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l></l></list><l>	// private static constants
34
&#xD;								var STEPPER = 0x72								
35
&#xD;								CONFIG = 0,								
36
&#xD;								STEP = 1,
37
&#xD;								DRV_4WIRE = 0x04,
38
&#xD;								MAX_STEPS = 2097151, // 21 bits (2^21 - 1) 
39
&#xD;								MAX_SPEED = 16383, // 14 bits (2^14 - 1)
40
&#xD;								stepper1_directionPin = 3,
41
&#xD;								stepper1_stepPin = 5,
42
&#xD;								stepper1_motorPin3 = 6,
43
&#xD;								stepper1_motorPin4 = 4,	
44
&#xD;								stepper2_directionPin = 10,
45
&#xD;								stepper2_stepPin = 12,
46
&#xD;								stepper2_motorPin3 = 13,
47
&#xD;								stepper2_motorPin4 = 11,	
48
&#xD;								CLOCKWISE = 0,
49
&#xD;								COUNTER_CLOCKWISE = 1;&#xD;
50
								
51
&#xD;								var numStepsForRev = 64;&#xD;&#xD;        this.arduino.board.pinMode(8,this.arduino.board.MODES.SERVO);&#xD;        &#xD;        this.arduino.board.stepperConfig(0, DRV_4WIRE, numStepsForRev, stepper1_directionPin, stepper1_stepPin, stepper1_motorPin3, stepper1_motorPin4);&#xD;        this.arduino.board.stepperConfig(1, DRV_4WIRE, numStepsForRev, stepper2_directionPin, stepper2_stepPin, stepper2_motorPin3, stepper2_motorPin4);        &#xD;								</l></block><list><l></l></list></block></script></block-definition><block-definition s="forward %&apos;distance&apos;" type="command" category="arduino"><header></header><code></code><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>done</l></list></block><block s="doSetVar"><l>done</l><block s="reportNewList"><list><l></l></list></block></block><block s="doRun"><block s="reportJSFunction"><list><l>done</l><l>distance</l></list><l>	// private static constants
52
&#xD;								CLOCKWISE = 0,
53
&#xD;								COUNTER_CLOCKWISE = 1;&#xD;&#xD;        var steps_rev = 4076/2;&#xD;        var wheel_dia = 64.5;&#xD;
54
								
55

    
56
&#xD;        var steps = distance * steps_rev / (wheel_dia * 3.1412); //24.61								&#xD;
57
&#xD;        var index = 0;&#xD;&#xD;        var doneCallback0 = function () {&#xD;           done.add(++index);&#xD;        }&#xD;&#xD;        var doneCallback1 = function () {&#xD;           done.add(++index);&#xD;        }&#xD;&#xD;        this.arduino.board.stepperStep(0, COUNTER_CLOCKWISE, steps, 4000, doneCallback0);					&#xD;        this.arduino.board.stepperStep(1, CLOCKWISE, steps, 4000, doneCallback1);
58
								</l></block><list><block var="done"/><block var="distance"/></list></block><block s="doWaitUntil"><block s="reportEquals"><block s="reportListItem"><l><option>last</option></l><block var="done"/></block><l>2</l></block></block></script></block-definition><block-definition s="backward %&apos;distance&apos;" type="command" category="arduino"><header></header><code></code><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>done</l></list></block><block s="doSetVar"><l>done</l><block s="reportNewList"><list><l></l></list></block></block><block s="doRun"><block s="reportJSFunction"><list><l>done</l><l>distance</l></list><l>	// private static constants
59
&#xD;								CLOCKWISE = 0,
60
&#xD;								COUNTER_CLOCKWISE = 1;&#xD;
61
								
62

    
63
&#xD;								var steps_rev = 4076/2;
64
&#xD;        var wheel_dia = 64.5;
65
&#xD;        var steps = distance * steps_rev / (wheel_dia * 3.1412); //24.61								&#xD;
66
&#xD;        var index = 0;&#xD;&#xD;        var doneCallback0 = function () {&#xD;           done.add(++index);&#xD;        }&#xD;&#xD;        var doneCallback1 = function () {&#xD;           done.add(++index);&#xD;        }&#xD;&#xD;        this.arduino.board.stepperStep(0, CLOCKWISE, steps, 4000, doneCallback0);					&#xD;        this.arduino.board.stepperStep(1, COUNTER_CLOCKWISE, steps, 4000, doneCallback1);
67
								</l></block><list><block var="done"/><block var="distance"/></list></block><block s="doWaitUntil"><block s="reportEquals"><block s="reportListItem"><l><option>last</option></l><block var="done"/></block><l>2</l></block></block></script></block-definition><block-definition s="left %&apos;degrees&apos;" type="command" category="arduino"><header></header><code></code><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>done</l></list></block><block s="doSetVar"><l>done</l><block s="reportNewList"><list><l></l></list></block></block><block s="doRun"><block s="reportJSFunction"><list><l>done</l><l>degrees</l></list><l>	// private static constants
68
&#xD;								CLOCKWISE = 0,
69
&#xD;								COUNTER_CLOCKWISE = 1;&#xD;
70
								
71

    
72
&#xD;								var steps_rev = 4076/2;
73
&#xD;        var wheel_dia = 64.5;
74
&#xD;        var wheel_base = 114.5;
75
&#xD;        var rotation = degrees / 360.0;
76
&#xD;        var distance = wheel_base * 3.1412 * rotation;
77
&#xD;        var steps = distance * steps_rev / (wheel_dia * 3.1412); //24.61								&#xD;
78
&#xD;        var index = 0;&#xD;&#xD;        var doneCallback0 = function () {&#xD;           done.add(++index);&#xD;        }&#xD;&#xD;        var doneCallback1 = function () {&#xD;           done.add(++index);&#xD;        }&#xD;&#xD;        this.arduino.board.stepperStep(0, COUNTER_CLOCKWISE, steps, 4000, doneCallback0);					&#xD;        this.arduino.board.stepperStep(1, COUNTER_CLOCKWISE, steps, 4000, doneCallback1);
79
								</l></block><list><block var="done"/><block var="degrees"/></list></block><block s="doWaitUntil"><block s="reportEquals"><block s="reportListItem"><l><option>last</option></l><block var="done"/></block><l>2</l></block></block></script></block-definition><block-definition s="right %&apos;degrees&apos;" type="command" category="arduino"><header></header><code></code><inputs><input type="%s"></input></inputs><script><block s="doDeclareVariables"><list><l>done</l></list></block><block s="doSetVar"><l>done</l><block s="reportNewList"><list><l></l></list></block></block><block s="doRun"><block s="reportJSFunction"><list><l>done</l><l>degrees</l></list><l>	// private static constants
80
&#xD;								CLOCKWISE = 0,
81
&#xD;								COUNTER_CLOCKWISE = 1;&#xD;
82
								
83

    
84
&#xD;								var steps_rev = 4076/2;
85
&#xD;        var wheel_dia = 64.5;&#xD;        var wheel_base = 114.5;&#xD;        var rotation = degrees / 360.0;&#xD;        var distance = wheel_base * 3.1412 * rotation;
86
&#xD;        var steps = distance * steps_rev / (wheel_dia * 3.1412); //24.61								&#xD;
87
&#xD;        var index = 0;&#xD;&#xD;        var doneCallback0 = function () {&#xD;           done.add(++index);&#xD;        }&#xD;&#xD;        var doneCallback1 = function () {&#xD;           done.add(++index);&#xD;        }&#xD;&#xD;        this.arduino.board.stepperStep(0, CLOCKWISE, steps, 4000, doneCallback0);					&#xD;        this.arduino.board.stepperStep(1, CLOCKWISE, steps, 4000, doneCallback1);
88
								</l></block><list><block var="done"/><block var="degrees"/></list></block><block s="doWaitUntil"><block s="reportEquals"><block s="reportListItem"><l><option>last</option></l><block var="done"/></block><l>2</l></block></block></script></block-definition></blocks><variables></variables></project>
(26-26/38)