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+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="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>"<#1>"</string><doWait>delay(<#1> * 1000);</doWait><doForever>void loop() {
 <#1>
}</doForever><doRepeat>for (int i = 0; i < <#1>; i++) {
 <#2>
}</doRepeat><doIf>if (<#1>) {
 <#2>
}</doIf><doIfElse>if (<#1>) {
 <#2>
} else {
 <#3>
}</doIfElse><reportSum>(<#1> + <#2>)</reportSum><reportDifference>(<#1> - <#2>)</reportDifference><reportProduct>(<#1> * <#2>)</reportProduct><reportQuotient>(<#1> / <#2>)</reportQuotient><reportModulus>(<#1> % <#2>)</reportModulus><reportMonadic><#1>(<#2>)</reportMonadic><reportRandom>random(<#1>, <#2>)</reportRandom><reportLessThan>(<#1> < <#2>)</reportLessThan><reportEquals>(<#1> == <#2>)</reportEquals><reportGreaterThan>(<#1> > <#2>)</reportGreaterThan><reportAnd>(<#1> && <#2>)</reportAnd><reportOr>(<#1> || <#2>)</reportOr><reportNot>!(<#1>)</reportNot><reportTrue>true</reportTrue><reportFalse>false</reportFalse><doSetVar><#1> = <#2>;</doSetVar><doChangeVar><#1> += <#2>;</doChangeVar><doDeclareVariables>int <#1>;</doDeclareVariables><reportAnalogReading>analogRead(<#1>)</reportAnalogReading><reportDigitalReading>digitalRead(<#1>)</reportDigitalReading><setPinMode>pinMode(<#1>, <#2>);</setPinMode><digitalWrite>digitalWrite(<#1>, <#2>);</digitalWrite><servoWrite>servo<#1>.write(<#2>);</servoWrite><pwmWrite>analogWrite(<#1>, <#2>);</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];
var R_stepper_pins = [3, 5, 6, 4];
for(pin = 0; pin < 4; pin++ ) 
{ 
 this.arduino.board.pinMode(L_stepper_pins[pin],this.arduino.board.MODES.OUTPUT); 
 this.arduino.board.digitalWrite(L_stepper_pins[pin], this.arduino.board.MODES.LOW); 
 this.arduino.board.pinMode(R_stepper_pins[pin],this.arduino.board.MODES.OUTPUT); 
 this.arduino.board.digitalWrite(R_stepper_pins[pin], this.arduino.board.MODES.LOW); 
}</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 %'distance'" 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; 
var wheel_base=114.5;
var steps_rev=512; 
var delay_time=6; 
var L_stepper_pins = [10, 12, 13, 11];
var R_stepper_pins = [3, 5, 6, 4]; 
var fwd_mask = [[1, 0, 1, 0], [0, 1, 1, 0], [0, 1, 0, 1], [1, 0, 0, 1]]; 
var rev_mask = [[1, 0, 0, 1], [0, 1, 0, 1], [0, 1, 1, 0], [1, 0, 1, 0]]; 
var steps = distance * steps_rev / (wheel_dia * 3.1412);
for(step = 0; step < steps; step++ ) { 
 for(mask = 0; mask < 4; mask++ ) { 
 for(pin = 0; pin < 4; pin++ ) { 
 this.arduino.board.digitalWrite(L_stepper_pins[pin], rev_mask[mask][pin]); 
 this.arduino.board.digitalWrite(R_stepper_pins[pin], fwd_mask[mask][pin]); 
 } 
 setTimeout('', delay_time); 
} 
}</l></block><list><block var="distance"/></list></block></script></block-definition><block-definition s="OLD backward %'distance'" 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; 
var wheel_base=114.5;
var steps_rev=512; 
var delay_time=6; 
var L_stepper_pins = [10, 12, 13, 11];
var R_stepper_pins = [3, 5, 6, 4]; 
var fwd_mask = [[1, 0, 1, 0], [0, 1, 1, 0], [0, 1, 0, 1], [1, 0, 0, 1]]; 
var rev_mask = [[1, 0, 0, 1], [0, 1, 0, 1], [0, 1, 1, 0], [1, 0, 1, 0]]; 
var steps = distance * steps_rev / (wheel_dia * 3.1412);
for(step = 0; step < steps; step++ ) { 
 for(mask = 0; mask < 4; mask++ ) { 
 for(pin = 0; pin < 4; pin++ ) { 
 this.arduino.board.digitalWrite(L_stepper_pins[pin], fwd_mask[mask][pin]); 
 this.arduino.board.digitalWrite(R_stepper_pins[pin], rev_mask[mask][pin]); 
 } 
 setTimeout('', delay_time); 
} 
}</l></block><list><block var="distance"/></list></block></script></block-definition><block-definition s="OLD right %'degrees'" 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; 
var wheel_base=114.5;
var steps_rev=512; 
var delay_time=6; 
var L_stepper_pins = [10, 12, 13, 11];
var R_stepper_pins = [3, 5, 6, 4]; 
var fwd_mask = [[1, 0, 1, 0], [0, 1, 1, 0], [0, 1, 0, 1], [1, 0, 0, 1]]; 
var rev_mask = [[1, 0, 0, 1], [0, 1, 0, 1], [0, 1, 1, 0], [1, 0, 1, 0]]; 
var rotation = degrees / 360;
var distance = wheel_base * 3.1412 * rotation;
var steps = distance * steps_rev / (wheel_dia * 3.1412);
for(step = 0; step < steps; step++ ) { 
 for(mask = 0; mask < 4; mask++ ) { 
 for(pin = 0; pin < 4; pin++ ) { 
 this.arduino.board.digitalWrite(R_stepper_pins[pin], rev_mask[mask][pin]); 
 this.arduino.board.digitalWrite(L_stepper_pins[pin], rev_mask[mask][pin]); 
 } 
 setTimeout('', delay_time); 
} 
}</l></block><list><block var="degrees"/></list></block></script></block-definition><block-definition s="OLD left %'degrees'" 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; 
var wheel_base=114.5;
var steps_rev=512; 
var delay_time=6; 
var L_stepper_pins = [10, 12, 13, 11];
var R_stepper_pins = [3, 5, 6, 4]; 
var fwd_mask = [[1, 0, 1, 0], [0, 1, 1, 0], [0, 1, 0, 1], [1, 0, 0, 1]]; 
var rev_mask = [[1, 0, 0, 1], [0, 1, 0, 1], [0, 1, 1, 0], [1, 0, 1, 0]]; 
var rotation = degrees / 360;
var distance = wheel_base * 3.1412 * rotation;
var steps = distance * steps_rev / (wheel_dia * 3.1412);
for(step = 0; step < steps; step++ ) { 
 for(mask = 0; mask < 4; mask++ ) { 
 for(pin = 0; pin < 4; pin++ ) { 
 this.arduino.board.digitalWrite(R_stepper_pins[pin], fwd_mask[mask][pin]); 
 this.arduino.board.digitalWrite(L_stepper_pins[pin], fwd_mask[mask][pin]); 
 } 
 setTimeout('', delay_time); 
} 
}</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
|