Progetto

Generale

Profilo

File » DrawingRobot_1.0.0.beta.xml

Andrea Cimini, 05-12-2015 12:54

 
1
<project name="DrawingRobot" app="Snap4Arduino 1.0.6 beta http://s4a.cat/snap" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAADoklEQVR4Xu3VTUqyARTF8SvayD4oQbKIqMDIqQiuoWVETlpF4zbgHgSh9bSFBhF9OIiyNxfgO/NwDv9n5EC4957z43kay39P8ZCAKIEGAEXJM3aVAACBIE0AgNL4GQ5ADEgTAKA0foYDEAPSBAAojZ/hAMSANAEASuNnOAAxIE0AgNL4GQ5ADEgTAKA0foYDEAPSBAAojZ/hAMSANAEASuNnOAAxIE0AgNL4GQ5ADEgTAKA0foYDEAPSBAAojZ/hAMSANAEASuNnOAAxIE0AgNL4GQ5ADEgTAKA0foYDEAPSBAAojZ/hAMSANAEASuNnOAAxIE0AgNL4GQ5ADEgTAKA0foYDEAPSBAAojZ/hAMSANAEASuNnOAAxIE0AgNL4GQ5ADEgTAKA0foYDEAPSBAAojZ/hAMSANAEASuNnOAAxIE0AgNL4GQ5ADEgTAKA0foYDEAPSBAAojZ/hAMSANAEASuNnOAAxIE0AgGvin06n1el06uLioi4vL2t7e1taVuJwAK5p9ebmpprNZvV6vdrf36/d3d3V77Ozszo6Oqq9vb1EExu9CYBr4p7P5/X4+Fjv7+/18vJSrVarTk5O6vz8vLrd7uqN+Afz+vp6o6UlDQPgf9q8u7ur5+fn+v7+ruVyufr319dXvb6+1tvbW/X7/ZrNZkkmNnoLANfE/fT0VA8PD6u332KxqEajUTs7O6s339+n+efnp46Pj+v+/n6jpSUNA+CaNieTSX18fNTW1lZ9fn5Wu92uq6urGo1GNRgM6vDwMMmC5BYAron99va2Tk9Pazgc1ng8roODA0lJyUMBmNyuwW0ANCgpeUUAJrdrcBsADUpKXhGAye0a3AZAg5KSVwRgcrsGtwHQoKTkFQGY3K7BbQA0KCl5RQAmt2twGwANSkpeEYDJ7RrcBkCDkpJXBGByuwa3AdCgpOQVAZjcrsFtADQoKXlFACa3a3AbAA1KSl4RgMntGtwGQIOSklcEYHK7BrcB0KCk5BUBmNyuwW0ANCgpeUUAJrdrcBsADUpKXhGAye0a3AZAg5KSVwRgcrsGtwHQoKTkFQGY3K7BbQA0KCl5RQAmt2twGwANSkpeEYDJ7RrcBkCDkpJXBGByuwa3AdCgpOQVAZjcrsFtADQoKXlFACa3a3AbAA1KSl4RgMntGtwGQIOSklcEYHK7BrcB0KCk5BUBmNyuwW0ANCgpeUUAJrdrcBsADUpKXhGAye0a3NYw2JEVgxP4BZADHLtwT2bLAAAAAElFTkSuQmCC</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="2.5390215264174816" y="-10.344892367906086" 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="29"><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="200"><block s="receiveKey"><l><option>q</option></l></block><custom-block s="penup"></custom-block></script><script x="215" y="196"><block s="receiveKey"><l><option>a</option></l></block><custom-block s="pendown"></custom-block></script><script x="10" y="281"><block s="receiveKey"><l><option>up arrow</option></l></block><custom-block s="forward %s"><l>1000</l></custom-block><custom-block s="done"></custom-block></script><script x="215" y="282"><block s="receiveKey"><l><option>down arrow</option></l></block><custom-block s="backward %s"><l>1000</l></custom-block><custom-block s="done"></custom-block></script><script x="213" y="374"><block s="receiveKey"><l><option>right arrow</option></l></block><custom-block s="right %s"><l>1000</l></custom-block><custom-block s="done"></custom-block></script><script x="15" y="380"><block s="receiveKey"><l><option>left arrow</option></l></block><custom-block s="left %s"><l>1000</l></custom-block><custom-block s="done"></custom-block></script><script x="495" y="54"><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="203" y="484"><block s="receiveKey"><l><option>space</option></l></block><custom-block s="init"></custom-block></script><script x="25" y="483"><block s="receiveKey"><l><option>9</option></l></block><custom-block s="testStepper"></custom-block></script><script x="514" y="384"><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></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="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.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;
54
								
55

    
56
&#xD;								var numSteps = 1050; //3700 x 1 giro di 360°								&#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, distance, 4000, doneCallback0);					&#xD;        this.arduino.board.stepperStep(1, CLOCKWISE, distance, 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 numSteps = 1050; //3700 x 1 giro di 360°								&#xD;
64
&#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, distance, 4000, doneCallback0);					&#xD;        this.arduino.board.stepperStep(1, COUNTER_CLOCKWISE, distance, 4000, doneCallback1);
65
								</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;angle&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>angle</l></list><l>	// private static constants
66
&#xD;								CLOCKWISE = 0,
67
&#xD;								COUNTER_CLOCKWISE = 1;&#xD;
68
								
69

    
70
&#xD;								var numSteps = 1050; //3700 x 1 giro di 360°								&#xD;
71
&#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, angle, 4000, doneCallback0);					&#xD;        this.arduino.board.stepperStep(1, COUNTER_CLOCKWISE, angle, 4000, doneCallback1);
72
								</l></block><list><block var="done"/><block var="angle"/></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;angle&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>angle</l></list><l>	// private static constants
73
&#xD;								CLOCKWISE = 0,
74
&#xD;								COUNTER_CLOCKWISE = 1;&#xD;
75
								
76

    
77
&#xD;								var numSteps = 1050; //3700 x 1 giro di 360°								&#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, CLOCKWISE, angle, 4000, doneCallback0);					&#xD;        this.arduino.board.stepperStep(1, CLOCKWISE, angle, 4000, doneCallback1);
79
								</l></block><list><block var="done"/><block var="angle"/></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>
(18-18/38)