<?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: Send integer on Serial to Arduino.</title>
		<atom:link href="http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/feed</link>
		<description></description>
		<pubDate>Thu, 20 Jun 2013 00:21:38 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-45915</guid>
					<title><![CDATA[Send integer on Serial to Arduino.]]></title>
					<link>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-45915</link>
					<pubDate>Fri, 16 Oct 2009 22:48:03 +0000</pubDate>
					<dc:creator>danielaaroe</dc:creator>

					<description>
						<![CDATA[
						<p>hey. Need some help here.<br />
Doing a project where were going to control a standard rc car using a iPhone 3g, 1 arduino (possably 2), and some RF modules.<br />
we are going to read the accelerometer data on the iphone and turning them in to throttle/turn commands.</p>
<p>I&#8217;ve managed to get the accelerometer data in to my max-patch(8 bit) so now I have 2 8-bit integers in number boxes which i don&#8217;t know how to send out on the serial port and to the arduino.</p>
<p>I need help to make the rest of the patch, so that i can send the two (continuously changing) 8-bit integers to the arduino.</p>
<p>Just imagine a blank patch with only two number boxes on it. the number in the boxes change continously(whole numbers, no decimals) and i want to send them to the arduino&#8230;<br />
How do i do that ?<br />
since this is real-time control, it needs do update at least 10 times a second.</p>
<p>Anyone have an idea of what to do ?<br />
I think this is a pretty basic thing to do, but i have almost no experience with the max 5 program!</p>
<p>thanks for reading, and thanks again for all help.</p>
<p>Daniel Aaroe</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165451</guid>
					<title><![CDATA[Re: Send integer on Serial to Arduino.]]></title>
					<link>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165451</link>
					<pubDate>Sat, 17 Oct 2009 04:40:39 +0000</pubDate>
					<dc:creator>seejayjames</dc:creator>

					<description>
						<![CDATA[
						<p>Try the [serial] object, and run the integers through [itoa] before they go in. or try [spell]. Some combination should get the Arduino to recognize them. You&#8217;ll have to send them as two-element lists, each with an index number that the Arduino code listens for (and then sends to the right place), or send them as a pair, with a start code for the Arduino to see. It&#8217;ll take a bit of fiddling but it should be fine. The key is the formatting for [serial].</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165452</guid>
					<title><![CDATA[Re: Send integer on Serial to Arduino.]]></title>
					<link>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165452</link>
					<pubDate>Sat, 17 Oct 2009 09:10:36 +0000</pubDate>
					<dc:creator>danielaaroe</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks, I&#8217;ve looked at it, but due to my lack of skills in the program, i can&#8217;t really make sense of it. It looks like the [serial] makes the &#8220;integer&#8221; to &#8220;binary&#8221;. But I dont really know anything for sure. </p>
<p>I&#8217;ll just upload the program, and whoever wants to, can take a look. I have not tried it yet. Don&#8217;t know if it does what it should. Left a few short comments there. And one long one. </p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165453</guid>
					<title><![CDATA[Re: Send integer on Serial to Arduino.]]></title>
					<link>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165453</link>
					<pubDate>Sun, 18 Oct 2009 12:09:44 +0000</pubDate>
					<dc:creator>pelang</dc:creator>

					<description>
						<![CDATA[
						<p>hi,</p>
<p>maybe this can halp you. the arduino code is not tested..</p>
<p>&#8212;&#8211;</p>
<p>char id;                     //max pak input 1( pak 0 1)<br />
int data = 0;                //max pak input data (pak 0 number)</p>
<p>
void setup() {</p>
<p>Serial.begin(9600);  </p>
<p>
}</p>
<p>
void loop()</p>
<p>{<br />
  while ((Serial.available() > 1)){</p>
<p> id = Serial.read();<br />
 data = Serial.read();</p>
<p>
 if (id == 2){                        </p>
<p>	if (data != 0){<br />
	  digitalWrite(12, HIGH);<br />
	}<br />
	else{<br />
	  digitalWrite(12, LOW);<br />
	}</p>
<p> }<br />
 if (id == 3){                      </p>
<p>	if (data != 0){<br />
	  digitalWrite(13, HIGH);<br />
	}<br />
	else{<br />
	  digitalWrite(13, LOW);<br />
	}<br />
 }</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>
&#8212;&#8212;</p>
<p>
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P comment 314 242 132 196617 this is your id number>>>>;<br />
#P toggle 476 212 15 0;<br />
#P newex 443 239 43 196617 pak 2 0;<br />
#P comment 487 243 132 196617 < <<< this is your data input;<br />
#P toggle 266 115 15 0;<br />
#P newex 238 139 43 196617 pak 2 0;<br />
#P comment 284 114 100 196617 enable;<br />
#P toggle 86 135 15 0;<br />
#P newex 86 104 44 196617 loadbang;<br />
#P newex 86 160 46 196617 metro 1;<br />
#P toggle 184 78 15 0;<br />
#P newex 156 102 38 196617 pak 3 0;<br />
#P newex 129 201 98 196617 serial a 9600 8 1 0;<br />
#P comment 202 77 100 196617 directions;<br />
#P connect 12 0 11 1;<br />
#P connect 9 0 8 1;<br />
#P connect 3 0 2 1;<br />
#P connect 8 0 1 0;<br />
#P connect 2 0 1 0;<br />
#P connect 4 0 1 0;<br />
#P connect 6 0 4 0;<br />
#P connect 5 0 6 0;<br />
#P window clipboard copycount 14;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165454</guid>
					<title><![CDATA[Re: Send integer on Serial to Arduino.]]></title>
					<link>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165454</link>
					<pubDate>Sun, 18 Oct 2009 12:23:27 +0000</pubDate>
					<dc:creator>danielaaroe</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks. I shall look at it more closely tonight. Did&#8217;nt quite figure out where to input the two integers. Even though it might look like it was at the [pak 2.0].</p>
<p>I see you made som arduino code as well. That was not necessary but I think it will help a lot when i start to write the arduino code. thanks again <img src="images/smiley_icons/icon_biggrin.gif" border=0 alt="Very Happy"/></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165455</guid>
					<title><![CDATA[Re: Send integer on Serial to Arduino.]]></title>
					<link>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165455</link>
					<pubDate>Sun, 18 Oct 2009 14:03:08 +0000</pubDate>
					<dc:creator>pelang</dc:creator>

					<description>
						<![CDATA[
						<p>this is should be more clear:</p>
<p>#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P comment 71 90 132 196617 this is your id number>>>>;<br />
#P number 200 89 34 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P comment 322 91 168 196617 < <<< this is your data input 0 - 255;<br />
#P number 278 89 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P comment 293 117 132 196617 < <<< this is your data input;<br />
#P newex 200 121 88 196617 pak 2 0;<br />
#P toggle 37 100 15 0;<br />
#P newex 37 69 44 196617 loadbang;<br />
#P newex 37 125 46 196617 metro 1;<br />
#P newex 129 201 98 196617 serial a 9600 8 1 0;<br />
#P connect 8 0 4 0;<br />
#P connect 6 0 4 1;<br />
#P connect 2 0 3 0;<br />
#P connect 3 0 1 0;<br />
#P connect 1 0 0 0;<br />
#P connect 4 0 0 0;<br />
#P window clipboard copycount 10;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165456</guid>
					<title><![CDATA[Re: Send integer on Serial to Arduino.]]></title>
					<link>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165456</link>
					<pubDate>Sun, 18 Oct 2009 14:53:22 +0000</pubDate>
					<dc:creator>danielaaroe</dc:creator>

					<description>
						<![CDATA[
						<p>yes it was. will try this. thanks man <img src="images/smiley_icons/icon_biggrin.gif" border=0 alt="Very Happy"/></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165457</guid>
					<title><![CDATA[Re: Send integer on Serial to Arduino.]]></title>
					<link>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165457</link>
					<pubDate>Sun, 18 Oct 2009 15:51:21 +0000</pubDate>
					<dc:creator>danielaaroe</dc:creator>

					<description>
						<![CDATA[
						<p>Do i put both the data inputs in the same [pak].</p>
<p>The id number, is that there to seperate the two integers from each other ?(if so, i thought i should just mux/demux the ints to send them on the same serial without identifiers)&#8230;</p>
<p>sorry if the questions are stupid. I&#8217;m new at this.</p>
<p>
I tried that, and this is how it looks like. Think this could work?<br />
(have not used the id number box. have not muxed them either!)</p>
<p>thanks.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165458</guid>
					<title><![CDATA[Re: Send integer on Serial to Arduino.]]></title>
					<link>http://cycling74.com/forums/topic/send-integer-on-serial-to-arduino/#post-165458</link>
					<pubDate>Sun, 18 Oct 2009 19:02:13 +0000</pubDate>
					<dc:creator>pelang</dc:creator>

					<description>
						<![CDATA[
						<p>hi</p>
<p>use for each data stream one [pak] object and give as first argument another id number.</p>
<p>#P user multiSlider 170 49 17 79 0. 255. 1 2665 47 0 0 2 0 0 0;<br />
#M frgb 0 0 0;<br />
#M brgb 255 255 255;<br />
#M rgb2 127 127 127;<br />
#M rgb3 0 0 0;<br />
#M rgb4 37 52 91;<br />
#M rgb5 74 105 182;<br />
#M rgb6 112 158 18;<br />
#M rgb7 149 211 110;<br />
#M rgb8 187 9 201;<br />
#M rgb9 224 62 37;<br />
#M rgb10 7 114 128;<br />
#P user multiSlider 237 47 17 79 0. 255. 1 2665 47 0 0 2 0 0 0;<br />
#M frgb 0 0 0;<br />
#M brgb 255 255 255;<br />
#M rgb2 127 127 127;<br />
#M rgb3 0 0 0;<br />
#M rgb4 37 52 91;<br />
#M rgb5 74 105 182;<br />
#M rgb6 112 158 18;<br />
#M rgb7 149 211 110;<br />
#M rgb8 187 9 201;<br />
#M rgb9 224 62 37;<br />
#M rgb10 7 114 128;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P newex 200 144 43 196617 pak 2 0;<br />
#P toggle 39 124 15 0;<br />
#P newex 39 93 44 196617 loadbang;<br />
#P newex 39 149 46 196617 metro 1;<br />
#P newex 141 147 38 196617 pak 3 0;<br />
#P newex 129 201 98 196617 serial a 9600 8 1 0;<br />
#P connect 7 0 1 1;<br />
#P connect 6 0 5 1;<br />
#P connect 3 0 4 0;<br />
#P connect 4 0 2 0;<br />
#P connect 2 0 0 0;<br />
#P connect 1 0 0 0;<br />
#P connect 5 0 0 0;<br />
#P window clipboard copycount 8;</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

