<div><div>I'm going to be floating around. I'm bringing a case of water.</div><div><br></div><div>And a drawbot. Anybody want to have a whirl at tweaking the program? </div><div><br></div><div>It's pretty simple. It uses the random function to come up with motor turns and then tries to stay on the page using some upper and lower bounds. </div>
<div><br></div><div><br></div><div><br></div><div><div>#include <AFMotor.h></div><div><br></div><div>AF_Stepper motor(48, 1);</div><div>AF_Stepper motor2(48, 2);</div><div><br></div><div>void setup() {</div><div> Serial.begin(9600); // set up Serial library at 9600 bps</div>
<div> Serial.println("Stepper test!");</div><div><br></div><div><br></div><div> motor.setSpeed(280); // 10 rpm</div><div> motor2.setSpeed(280);</div><div> // motor.setSpeed(280); // 10 rpm</div><div> // motor2.setSpeed(280);</div>
<div>}</div><div><br></div><div>int x=0;</div><div>int y=0;</div><div><br></div><div>int xBound = 1000;</div><div>int yBound = 1000;</div><div><br></div><div>int dx;</div><div>int dy;</div><div>int xd;</div><div>int yd;</div>
<div><br></div><div>void loop() {</div><div> </div><div> dx = random (0,500);</div><div> dy = 1000-dx + random (0, 100);</div><div> //dy = random (0,500);</div><div> xd = random (0, 100);</div><div> yd = random (0, 100);</div>
<div>// xd = 1;</div><div> //yd = 1;</div><div><br></div><div> if (xd > 50) { </div><div> if (x <= xBound) {</div><div> motor.step(dx, FORWARD, INTERLEAVE);</div><div> x = x + dx;</div><div> } else {</div>
<div> </div><div> }</div><div> } else {</div><div> if (x >= -xBound) {</div><div> motor.step(dx, BACKWARD, INTERLEAVE);</div><div> x = x - dx;</div><div> } else {</div><div> </div><div> }</div>
<div> }</div><div> if (yd > 50) {</div><div> if (y <= yBound) { </div><div> motor2.step(dy, FORWARD, INTERLEAVE);</div><div> y = y + dy;</div><div> } else {</div><div> </div><div> }</div><div> } else {</div>
<div> if (y >= -yBound) {</div><div> motor2.step(dy, BACKWARD, INTERLEAVE);</div><div> y = y - dy;</div><div> } else {</div><div> </div><div> }</div><div> }</div><div> </div><div> //motor.step(1500, BACKWARD, INTERLEAVE);</div>
<div> //motor2.step(1500, BACKWARD, INTERLEAVE); </div><div><br></div><div><br></div><div>}</div><div><br></div><div><br></div><div> //Serial.println("Single coil steps");</div><div> //motor.step(10000, FORWARD, SINGLE);</div>
<div> //motor.step(100, BACKWARD, SINGLE); </div><div><br></div><div> //Serial.println("Double coil steps");</div><div> //motor.step(10000, FORWARD, DOUBLE);</div><div> //motor.step(100, BACKWARD, DOUBLE);</div>
<div><br></div><div> //Serial.println("Interleave coil steps");</div><div> </div><div> //#ifdef MICROSTEPPING</div><div>// Serial.println("Micrsostep steps");</div><div>// motor.step(100, FORWARD, MICROSTEP);</div>
<div>// motor.step(100, BACKWARD, MICROSTEP);</div><div>//#endif</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br>
<br><br><div class="gmail_quote">On Wed, Jul 20, 2011 at 1:02 PM, Jean-Claude Batista <span dir="ltr"><<a href="mailto:jeanclaudebatista@gmail.com">jeanclaudebatista@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<p><span>Heat shouldn't prevent some soldering fun!</span></p><p><span>You can RSVP using the
following link: <a href="http://bit.ly/qYrZOl" target="_blank">http://bit.ly/qYrZOl</a></span></p><p>/jc</p><div class="gmail_quote">On Wed, Jul 20, 2011 at 10:52 AM, Bruce <span dir="ltr"><<a href="mailto:lists@faintfuzzies.ca" target="_blank">lists@faintfuzzies.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On July 20, 2011 08:06:42 AM Andrew Plumb wrote:<br>
> Anyone else planning to be there tonight, besides myself?<br>
><br>
> Andrew.<br>
><br>
> --</div><div><div>
_______________________________________________<br>
Lab mailing list<br>
<a href="mailto:Lab@artengine.ca" target="_blank">Lab@artengine.ca</a><br>
<a href="http://artengine.ca/mailman/listinfo/lab" target="_blank">http://artengine.ca/mailman/listinfo/lab</a><br>
</div></div></blockquote></div><br>
<br>_______________________________________________<br>
Lab mailing list<br>
<a href="mailto:Lab@artengine.ca">Lab@artengine.ca</a><br>
<a href="http://artengine.ca/mailman/listinfo/lab" target="_blank">http://artengine.ca/mailman/listinfo/lab</a><br>
<br></blockquote></div><br>