Progetto

Generale

Profilo

File » DrawingRobot.xml

Progetto Snap4Arduino - Andrea Cimini, 18-11-2015 23:26

 
1
<project name="DrawingRobot" app="Snap4Arduino 1.0.6 beta http://s4a.cat/snap" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAADCElEQVR4Xu3VMW5aARRE0e992L1ZDgUbcuMNeT14IRRJ5CJy4yQaRhnJOr+F9544XMHDj1/P4SEwEngQ4Eje2Q8BAQphKiDAKb/jAtTAVECAU37HBaiBqYAAp/yOC1ADUwEBTvkdF6AGpgICnPI7LkANTAUEOOV3XIAamAoIcMrvuAA1MBUQ4JTfcQFqYCogwCm/4wLUwFRAgFN+xwWogamAAKf8jgtQA1MBAU75HRegBqYCApzyOy5ADUwFBDjld1yAGpgKCHDK77gANTAVEOCU33EBamAqIMApv+MC1MBUQIBTfscFqIGpgACn/I4LUANTAQFO+R0XoAamAgKc8jsuQA1MBQQ45XdcgBqYCghwyu+4ADUwFRDglN9xAWpgKiDAKb/jAtTAVECAU37HBaiBqYAAp/yOC1ADUwEBfsF/Op2Ol5eX43K5TL+g735cgH/4hs/n8+9Xr9fr8fb2djw9PX33Jv7r5xPgX7g/R/j5rbfb7SNIz30CAhTgfQXdOS3Af/wLfn9///jFe3x8vJPc+GcBAX7Rw/Pz8/H6+np89Rcso46AADuOtoQCAgzhjHUEBNhxtCUUEGAIZ6wjIMCOoy2hgABDOGMdAQF2HG0JBQQYwhnrCAiw42hLKCDAEM5YR0CAHUdbQgEBhnDGOgIC7DjaEgoIMIQz1hEQYMfRllBAgCGcsY6AADuOtoQCAgzhjHUEBNhxtCUUEGAIZ6wjIMCOoy2hgABDOGMdAQF2HG0JBQQYwhnrCAiw42hLKCDAEM5YR0CAHUdbQgEBhnDGOgIC7DjaEgoIMIQz1hEQYMfRllBAgCGcsY6AADuOtoQCAgzhjHUEBNhxtCUUEGAIZ6wjIMCOoy2hgABDOGMdAQF2HG0JBQQYwhnrCAiw42hLKCDAEM5YR0CAHUdbQgEBhnDGOgIC7DjaEgoIMIQz1hEQYMfRllBAgCGcsY6AADuOtoQCAgzhjHUEBNhxtCUUEGAIZ6wjIMCOoy2hgABDOGMdAQF2HG0JBQQYwhnrCAiw42hLKPAT12n8qPmYkCQAAAAASUVORK5CYII=</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+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+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="0" y="0" 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="39" y="30"><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="26" y="201"><block s="receiveKey"><l><option>q</option></l></block><custom-block s="penup"></custom-block></script><script x="224" y="197"><block s="receiveKey"><l><option>a</option></l></block><custom-block s="pendown"></custom-block></script><script x="19" y="282"><block s="receiveKey"><l><option>up arrow</option></l></block><custom-block s="forward %s"><l>20</l></custom-block><custom-block s="done"></custom-block></script><script x="224" y="283"><block s="receiveKey"><l><option>down arrow</option></l></block><custom-block s="backward %s"><l>20</l></custom-block><custom-block s="done"></custom-block></script><script x="222" y="375"><block s="receiveKey"><l><option>right arrow</option></l></block><custom-block s="right %s"><l>90</l></custom-block><custom-block s="done"></custom-block></script><script x="24" y="381"><block s="receiveKey"><l><option>left arrow</option></l></block><custom-block s="left %s"><l>90</l></custom-block><custom-block s="done"></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.pinMode(8,this.arduino.board.MODES.SERVO);&#xD;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="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="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="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="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></blocks><variables></variables></project>
(11-11/38)