<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: Arduino Stepper control through Max Msp Kinect</title>
		<atom:link href="http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/feed</link>
		<description></description>
		<pubDate>Tue, 18 Jun 2013 00:55:28 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-64305</guid>
					<title><![CDATA[Arduino Stepper control through Max Msp Kinect]]></title>
					<link>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-64305</link>
					<pubDate>Mon, 10 Sep 2012 15:24:01 +0000</pubDate>
					<dc:creator>hanu</dc:creator>

					<description>
						<![CDATA[
						<p>hi</p>
<p>i trying to find out what is the best solution to control two stepper motors with arduino and max msp.<br />
i tried maxuino but i wont work.<br />
i am using an max msp 6, arduino uno, two easy driver boards and two steppers (<a href="https://www.sparkfun.com/products/9238" rel="nofollow">https://www.sparkfun.com/products/9238</a>).<br />
Servo control is not a problem but in this setup that isnt the solution.<br />
So it would be very nice if someone could share his solution to control steppers with Max.</p>
<p>I tried the Serialfunction with this code below but it was not working.. So if anyone could point me in the right direction<br />
( <a href="http://bildr.org/2011/06/easydriver/" rel="nofollow">http://bildr.org/2011/06/easydriver/</a> )</p>
<p>//////////////////////////////////////////////////////////////////<br />
//©2011 bildr<br />
//Released under the MIT License &#8211; Please reuse change and share<br />
//Using the easy stepper with your arduino<br />
//use rotate and/or rotateDeg to controll stepper motor<br />
//speed is any number from .01 -> 1 with 1 being fastest -<br />
//Slower Speed == Stronger movement<br />
/////////////////////////////////////////////////////////////////</p>
<p>#define DIR_PIN 2<br />
#define STEP_PIN 3</p>
<p>void setup() {<br />
  pinMode(DIR_PIN, OUTPUT);<br />
  pinMode(STEP_PIN, OUTPUT);<br />
} </p>
<p>void loop(){ </p>
<p>  //rotate a specific number of degrees<br />
  rotateDeg(360, 1);<br />
  delay(1000);</p>
<p>  rotateDeg(-360, .1);  //reverse<br />
  delay(1000); </p>
<p>  //rotate a specific number of microsteps (8 microsteps per step)<br />
  //a 200 step stepper would take 1600 micro steps for one full revolution<br />
  rotate(1600, .5);<br />
  delay(1000); </p>
<p>  rotate(-1600, .25); //reverse<br />
  delay(1000);<br />
}</p>
<p>void rotate(int steps, float speed){<br />
  //rotate a specific number of microsteps (8 microsteps per step) &#8211; (negitive for reverse movement)<br />
  //speed is any number from .01 -> 1 with 1 being fastest &#8211; Slower is stronger<br />
  int dir = (steps > 0)? HIGH:LOW;<br />
  steps = abs(steps);</p>
<p>  digitalWrite(DIR_PIN,dir); </p>
<p>  float usDelay = (1/speed) * 70;</p>
<p>  for(int i=0; i < steps; i++){<br />
    digitalWrite(STEP_PIN, HIGH);<br />
    delayMicroseconds(usDelay); </p>
<p>    digitalWrite(STEP_PIN, LOW);<br />
    delayMicroseconds(usDelay);<br />
  }<br />
} </p>
<p>void rotateDeg(float deg, float speed){<br />
  //rotate a specific number of degrees (negitive for reverse movement)<br />
  //speed is any number from .01 -> 1 with 1 being fastest &#8211; Slower is stronger<br />
  int dir = (deg > 0)? HIGH:LOW;<br />
  digitalWrite(DIR_PIN,dir); </p>
<p>  int steps = abs(deg)*(1/0.225);<br />
  float usDelay = (1/speed) * 70;</p>
<p>  for(int i=0; i < steps; i++){<br />
    digitalWrite(STEP_PIN, HIGH);<br />
    delayMicroseconds(usDelay); </p>
<p>    digitalWrite(STEP_PIN, LOW);<br />
    delayMicroseconds(usDelay);<br />
  }<br />
}</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231849</guid>
					<title><![CDATA[Re: Arduino Stepper control through Max Msp Kinect]]></title>
					<link>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231849</link>
					<pubDate>Mon, 10 Sep 2012 16:55:22 +0000</pubDate>
					<dc:creator>tobiasros</dc:creator>

					<description>
						<![CDATA[
						<p>i remember i once found help here:</p>
<p><a href="http://cycling74.com/forums/topic.php?id=8503" rel="nofollow">http://cycling74.com/forums/topic.php?id=8503</a></p>
<p>worked with maxuino in these days&#8230;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231850</guid>
					<title><![CDATA[Re: Arduino Stepper control through Max Msp Kinect]]></title>
					<link>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231850</link>
					<pubDate>Mon, 10 Sep 2012 17:55:23 +0000</pubDate>
					<dc:creator>Scott Fitzgerald</dc:creator>

					<description>
						<![CDATA[
						<p>I&#8217;ve never used an easy board before, but this should be enough to get you started with taking steps in one direction :</p>
<p>
#define DIR_PIN 2<br />
#define STEP_PIN 3</p>
<p>void setup() {<br />
  pinMode(DIR_PIN, OUTPUT);<br />
  pinMode(STEP_PIN, OUTPUT);<br />
  //being serial communication<br />
  Serial.begin(9600);<br />
}</p>
<p>void loop(){<br />
  //create variable to hold the number of steps<br />
  int steps =0;<br />
  // if there&#8217;s serial information in the buffer<br />
  // save that in the steps variable<br />
  if(Serial.available()>0){<br />
    steps = Serial.read();<br />
  }<br />
  //rotate a specific number of degrees<br />
  rotate(steps*8, 1);<br />
  //wait for a moment<br />
  delay(5);<br />
}</p>
<p>void rotate(int steps, float speed){<br />
  //rotate a specific number of microsteps (8 microsteps per step) &#8211; (negitive for reverse movement)<br />
  //speed is any number from .01 -> 1 with 1 being fastest &#8211; Slower is stronger<br />
  int dir = (steps > 0)? HIGH:LOW;<br />
  steps = abs(steps);</p>
<p>  digitalWrite(DIR_PIN,dir);</p>
<p>  float usDelay = (1/speed) * 70;</p>
<p>  for(int i=0; i < steps; i++){<br />
    digitalWrite(STEP_PIN, HIGH);<br />
    delayMicroseconds(usDelay);</p>
<p>    digitalWrite(STEP_PIN, LOW);<br />
    delayMicroseconds(usDelay);<br />
  }<br />
}
</p>
<div><span id="toggle231850-0" class="patchtoggle" onmousedown="toggleMaxPatch('post231850-0', 'er231850-0');">&#8211; Pasted Max <span id="maxversion231850-0"></span> Patch, click to <span id="er231850-0">expand</span>. &#8211;</span> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  width="110" height="14" class="clippy" ><param name="allowScriptAccess" value="always" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param NAME="FlashVars" value="copied=copied!&#038;copyto=copy to clipboard"/><param name="bgcolor" value="#FFFFFF"/><param name="wmode" value="opaque"/><embed src="/wp-content/plugins/bbpress-copy-compressed/clippy.swf"  width="110" height="14"   name="clippy"  quality="high"  allowScriptAccess="always"  type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer"  FlashVars="text=----------begin_max5_patcher----------%0A742.3ocwXssbaBCD8Y3qPCO61AItE5ac5%2BPeoSlLx3M1JAjXPxooMS92qt.A%0ARqHFmFRdQjc8ZzdN6dVImGBCh1JtGjQnuf9AJH3gvf.qKiifd6fnF58U0ToM%0ArnJQSCvUQabelBtWY8yO1rE5PhqQREzJQJARQuEFhisyFkX6MeJYvm9qv30f%0Ax9hw8NuVvUR1uAqOxmiGiUbTMD7f2Vpp5.iu%2BpNnR4PAV%2BUPE1UbVr4AQuht%0AbxqmSaru9nu1wn0QlO3wvPyxlERBNv5Aa4QOkYc5cQAcWAb51ZXZVeZbGOCt%0AI8dctT%2BpEbfNhYpHnnsT99nmvpdWXMGalt0ZTL3hjkMOKVZIvxBypiEwkywh%0AeG51Q4zWEOB%2BTyZ%2BSujDp0YBJFg809D6s%2BI4b5eRliGsD3lwmijoGRhPHiMa%0A4jUpWaNAWUMq5VzAnCLZspZgT%2BGG.jDL6DpUzo7vdj7UU8QJbMKCrQ9GJoHZ%0AA9R3jh0kSJyrbRR95xIMfTR2Cd3DcqgOXi8Bax4.a7bBokHb56RRJsFW7tQH%0Al1.D0CifK%2BvXjzzI8Ho3UhQlS17smIa1CZ5AUyjJ6w4iZGoutnUU6jfcZGb%2B%0AI4Eqj1QI1uu1mHAie0mnuv9ByQ2KPrj3ZPxFVQW9VpH5XbeSFwIeXBh7zIEd%0AmrXEDDydADaOOEUlGG6iWR%2B%2B65O0c4dQ5AOLzzRLWj9NeLqadgdTgTQ8djJd%0AkORMsbhl.etSErgEUy3%2B8O8wtUF%2BOmSjhicUCkmgoBnwcaGHULNUwD7IAYtn%0A5jfNv1sC3O6x3rcsBc0tOIHISuHo1HyYLtMLoYvikki8VMWZ9aSM7Ixeyogu%0AX9%2BFmOmhOI32s7grj5qYHv4VeyLZVh8Q5EOYsBU3%2Bp38FgfrDaNmUNEAFq0.%0AAIqABJbHnuTzi.i0Jff7U..33XaJWTLE.FqSB.2TOZa6cPmrOKr4tdl%2BMhNi%0AY9lP2%2B2.moMGh5f6XCwmEZdaOF9GdhvMo.%0A-----------end_max5_patcher-----------&#038;copied=copied!&#038;;copyto=copy to clipboard"  bgcolor="#ffffff"  wmode="opaque" /> </object></div>
<div id="post231850-0" style="display:none;visibility:hidden;" >
<div class="patchtoggleInfo"><small>Copy <b>all</b> of the following text.Then, in Max, select <em>New From Clipboard</em>.</small></div>
<div class="patchtogglediv">
<pre><code id="pastedcode231850-0">----------begin_max5_patcher----------
742.3ocwXssbaBCD8Y3qPCO61AItE5ac5+PeoSlLx3M1JAjXPxooMS92qt.A
RqHFmFRdQjc8ZzdN6dVImGBCh1JtGjQnuf9AJH3gvf.qKiifd6fnF58U0ToM
rnJQSCvUQabelBtWY8yO1rE5PhqQREzJQJARQuEFhisyFkX6MeJYvm9qv30f
x9hw8NuVvUR1uAqOxmiGiUbTMD7f2Vpp5.iu+pNnR4PAV+UPE1UbVr4AQuht
bxqmSaru9nu1wn0QlO3wvPyxlERBNv5Aa4QOkYc5cQAcWAb51ZXZVeZbGOCt
I8dctT+pEbfNhYpHnnsT99nmvpdWXMGalt0ZTL3hjkMOKVZIvxBypiEwkywh
eG51Q4zWEOB+TyZ+SujDp0YBJFg809D6s+I4b5eRliGsD3lwmijoGRhPHiMa
4jUpWaNAWUMq5VzAnCLZspZgT+GG.jDL6DpUzo7vdj7UU8QJbMKCrQ9GJoHZ
A9R3jh0kSJyrbRR95xIMfTR2Cd3DcqgOXi8Bax4.a7bBokHb56RRJsFW7tQH
l1.D0CifK+vXjzzI8Ho3UhQlS17smIa1CZ5AUyjJ6w4iZGoutnUU6jfcZGb+
I4Eqj1QI1uu1mHAie0mnuv9ByQ2KPrj3ZPxFVQW9VpH5XbeSFwIeXBh7zIEd
mrXEDDydADaOOEUlGG6iWR++65O0c4dQ5AOLzzRLWj9NeLqadgdTgTQ8djJd
kORMsbhl.etSErgEUy3+8O8wtUF+OmSjhicUCkmgoBnwcaGHULNUwD7IAYtn
5jfNv1sC3O6x3rcsBc0tOIHISuHo1HyYLtMLoYvikki8VMWZ9aSM7Ixeyogu
X9+FmOmhOI32s7grj5qYHv4VeyLZVh8Q5EOYsBU3+p38FgfrDaNmUNEAFq0.
AIqABJbHnuTzi.i0Jff7U..33XaJWTLE.FqSB.2TOZa6cPmrOKr4tdl+MhNi
Y9lP2+2.moMGh5f6XCwmEZdaOF9GdhvMo.
-----------end_max5_patcher-----------</code></pre></div>
</div>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231851</guid>
					<title><![CDATA[Re: Arduino Stepper control through Max Msp Kinect]]></title>
					<link>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231851</link>
					<pubDate>Tue, 11 Sep 2012 11:25:11 +0000</pubDate>
					<dc:creator>hanu</dc:creator>

					<description>
						<![CDATA[
						<p>thank you so much scott!<br />
now i will try to change the code.<br />
<a href='http://cycling74.com/forums/users/tobias/' rel='nofollow' class='bbp-mention-link tobias'>@tobias</a><br />
maxuino will einfach nicht funktionieren habe wirklich alles probiert und es an verschiedenen rechner ausprobiert und es will einfach nicht &#8230;<br />
keine ahnung was ich falsch mache aber ich bin am verzweifeln und versuche jetzt den &#8220;umweg&#8221; über serial read zu gehen. obwohl ich natürlich maxuino vorziehen würde, da ich was code angeht ein vollkommener neuling bin und max mir mit den nodes schon sehr zusagt. also falls du mir irgendwie mit maxuino weiterhelfen könntest wäre ich dir verdammt dankbar!</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231852</guid>
					<title><![CDATA[Re: Arduino Stepper control through Max Msp Kinect]]></title>
					<link>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231852</link>
					<pubDate>Tue, 11 Sep 2012 11:48:14 +0000</pubDate>
					<dc:creator>tobiasros</dc:creator>

					<description>
						<![CDATA[
						<p>hey, when i used maxuino with steppers the stepper libraries where non existing back then, and i think i used something as a l293 motor driver..<br />
i just had a quick look on the maxuino-webpage &#8211; </p>
<p>&#8212; This version of maxuino has stepper capability, but only if you also use our stepperFirmata variant.  If you use the Firmata that is shipped with the Arduino IDE it will work just fine for everything except it will not run stepper motors.</p>
<p>did you upload the stepperFirmata or just Standart Firmata?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231853</guid>
					<title><![CDATA[Re: Arduino Stepper control through Max Msp Kinect]]></title>
					<link>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231853</link>
					<pubDate>Tue, 11 Sep 2012 11:54:50 +0000</pubDate>
					<dc:creator>hanu</dc:creator>

					<description>
						<![CDATA[
						<p>hey tobias</p>
<p>i tried both but it wont work. at the moment i am trying to figure out how to change scotts code to make a direction change but later i will give maxuino another try&#8230;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231854</guid>
					<title><![CDATA[Re: Arduino Stepper control through Max Msp Kinect]]></title>
					<link>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231854</link>
					<pubDate>Tue, 11 Sep 2012 12:46:28 +0000</pubDate>
					<dc:creator>tobiasros</dc:creator>

					<description>
						<![CDATA[
						<p>ok, you most probably also did:</p>
<p>- “Dont forget you need to add stepperDriver to your arduino libraries folder and restart Arduino IDE to get this Firmata to work.&#8221;</p>
<p>and </p>
<p>- &#8220;set the modes for each of the pins you will use. [...]  the digital pins are on the right and have 7 modes:</p>
<p>    Digital input<br />
    Digital output<br />
    Analog input (some boards have pins that can do both modes)<br />
    PWM output<br />
    Servo<br />
    Stepper Motor Step<br />
    Stepper Motor Direction</p>
<p> [attachment=203189,4388]</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231855</guid>
					<title><![CDATA[Re: Arduino Stepper control through Max Msp Kinect]]></title>
					<link>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231855</link>
					<pubDate>Tue, 11 Sep 2012 14:05:29 +0000</pubDate>
					<dc:creator>hanu</dc:creator>

					<description>
						<![CDATA[
						<p>yea you are right i tried that.<br />
i just discovered that the stepper driver <stepperdriver .h> is not yellow is this perhaps the problem? but i copied the StepperDriver into the arduino libaries and also in the arduino libraries folder in the document section. which is the correct one? </stepperdriver></p>
<p>i also discovered a strange thing i made a picture to explain it.. perhaps someone can understand it&#8230;</p>
<p>edit: i know its not the right PIN configuration but thats the only way to move the stepper. with the right DIR and STEP Pin configuration its not working</p>
<p> [attachment=203200,4391] [attachment=203200,4392]</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231856</guid>
					<title><![CDATA[Re: Arduino Stepper control through Max Msp Kinect]]></title>
					<link>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231856</link>
					<pubDate>Tue, 11 Sep 2012 19:22:45 +0000</pubDate>
					<dc:creator>hanu</dc:creator>

					<description>
						<![CDATA[
						<p>so i reinstalled everything and the problem is still there. i uploaded the stepperfirmata from maxuino and set the right pin configuration.<br />
the rx led on the arduino board is blinking when i move the STEP Pin in max so its getting information but the stepper is not moving :(</p>
<p>there is an example code from the maxuino stepper driver which is:</p>
<p>#include <stepperdriver .h></stepperdriver></p>
<p>const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution for your motor<br />
StepperDriver myStepper; //initialize for one stepper</p>
<p>void setup() {<br />
  myStepper.setStep(stepsPerRevolution, 12,10);<br />
  myStepper.setSpeed(8); //with 1/8th stepping turned on, 1 rpm * 8 = 8<br />
  myStepper.step(stepsPerRevolution*8); //with 1/8 stepping turned on, one full revolution needs to be multiplied x 8<br />
}</p>
<p>void loop() {<br />
// step one revolution in one direction:</p>
<p>  if (myStepper.update() == 1){ //here we check to see if the motor has finished the last step command and at the same time call the update for the motor to keep running<br />
    delay(1000); //when a full revolution is complete, wait 1second and do another full rev.<br />
    myStepper.step(stepsPerRevolution*8);<br />
  }<br />
}</p>
<p>this example code is working. so i think the problem is in the max patch?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231857</guid>
					<title><![CDATA[Re: Arduino Stepper control through Max Msp Kinect]]></title>
					<link>http://cycling74.com/forums/topic/arduino-stepper-control-through-max-msp-kinect/#post-231857</link>
					<pubDate>Sun, 28 Apr 2013 13:10:42 +0000</pubDate>
					<dc:creator>helios</dc:creator>

					<description>
						<![CDATA[
						<p>hey scott,<br />
your answer is perfect for me!<br />
it&#8217;s work nicely BUT i would like to turn the stepper in other direction<br />
i don&#8217;t know how send negative value to arduino &#8230;<br />
i found a bad solution, is to map the max value to have negative value in arduino!<br />
it&#8217;s work but i think there is better solution</p>
<p>#define DIR_PIN 2<br />
#define STEP_PIN 3<br />
int value;</p>
<p>void setup() {<br />
pinMode(DIR_PIN, OUTPUT);<br />
pinMode(STEP_PIN, OUTPUT);<br />
//being serial communication<br />
Serial.begin(9600);<br />
}</p>
<p>void loop(){<br />
//create variable to hold the number of steps<br />
int steps =0;<br />
// if there&#8217;s serial information in the buffer<br />
// save that in the steps variable<br />
if(Serial.available()>0){<br />
steps = Serial.read();<br />
value = map(steps,127,255,0,255); //donc tt ce qui est en dessous de 127 est négatif!!<br />
//all above 127 is negative<br />
}<br />
//rotate a specific number of degrees<br />
rotate(steps*8, 1);<br />
//wait for a moment<br />
delay(5);<br />
}</p>
<p>void rotate(int steps, float speed){<br />
//rotate a specific number of microsteps (8 microsteps per step) &#8211; (negitive for reverse movement)<br />
//speed is any number from .01 -> 1 with 1 being fastest &#8211; Slower is stronger<br />
int dir = (value > 0)? HIGH:LOW;<br />
steps = abs(steps);</p>
<p>digitalWrite(DIR_PIN,dir);</p>
<p>float usDelay = (1/speed) * 70;</p>
<p>for(int i=0; i < steps; i++){<br />
digitalWrite(STEP_PIN, HIGH);<br />
delayMicroseconds(usDelay);</p>
<p>digitalWrite(STEP_PIN, LOW);<br />
delayMicroseconds(usDelay);<br />
}<br />
}</p>
<p>do you have a better idea?<br />
thank&#8217;s</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

