<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Daily Duino &#187; Serial</title>
	<atom:link href="http://dailyduino.com/archives/category/communication/serial-communication/feed" rel="self" type="application/rss+xml" />
	<link>http://dailyduino.com</link>
	<description>mostly daily arduino projects and news</description>
	<lastBuildDate>Fri, 04 Dec 2009 19:46:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Basic Processing to Arduino Communications</title>
		<link>http://dailyduino.com/archives/483</link>
		<comments>http://dailyduino.com/archives/483#comments</comments>
		<pubDate>Fri, 20 Feb 2009 18:45:18 +0000</pubDate>
		<dc:creator>Morgellon</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Communication]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Serial]]></category>

		<guid isPermaLink="false">http://dailyduino.com/?p=483</guid>
		<description><![CDATA[Finally sat down and figured out how to send some basic signals via serial from Processing to an Arduino.  For this example I was just looking for basic functionality, so I settled for a simple way to turn a LED on and off.  It&#8217;s also mostly sample code gathered from the Internet. The Processing code [...]]]></description>
			<content:encoded><![CDATA[<p>Finally sat down and figured out how to send some basic signals via serial from Processing to an Arduino.  For this example I was just looking for basic functionality, so I settled for a simple way to turn a LED on and off.  It&#8217;s also mostly sample code gathered from the Internet.</p>
<p>The Processing code creates a small black square on the screen.  When the mouse cursor is moved over the square, it changes color to yellow and sends a &#8220;H&#8221; over serial to the Arduino.  While the Arduino detects a &#8220;H&#8221; on serial it will light the LED.</p>
<p>Here&#8217;s a video of it in action and describing how to get started.<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=3297670&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=3297670&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<a href="http://vimeo.com/3297670">Basic Processing to Arduino Communications</a> from <a href="http://vimeo.com/morgellon">Morgellon</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<ul>
<li style="text-align: center;"><strong>Download Processing</strong></li>
</ul>
<p style="text-align: center;"><a title="http://processing.org/download/index.html" href="http://processing.org/download/index.html" target="_blank">http://processing.org/download/index.html<br />
</a></p>
<ul>
<li style="text-align: center;"><strong>Download Arduino to Processing Library</strong></li>
</ul>
<p style="text-align: center;"><a title="http://www.arduino.cc/playground/Interfacing/Processing" href="http://www.arduino.cc/playground/Interfacing/Processing" target="_blank">http://www.arduino.cc/playground/Interfacing/Processing</a></p>
<p style="text-align: left;">Now that you&#8217;ve gotten all the files installed and in their proper places, try out my test code I used in the video.</p>
<p style="text-align: center;"><strong>Arduino Code</strong><em> (Download <a title="http://serverwillprovide.com/icuubi/examples/processing/AP_lightBlink.tar" href="http://serverwillprovide.com/icuubi/examples/processing/AP_lightBlink.tar" target="_blank">here</a>)</em></p>
<p style="text-align: left;"><em>//  Read data from the serial port and turn ON or OFF a light depending on the value</em></p>
<p><em>char val;         //Data received from the serial port<br />
int ledPin = 13;  //Set value ledPin to pin 13</em></p>
<p><em>void setup(){<br />
pinMode(ledPin, OUTPUT);  //Sets pin as OUTPUT<br />
Serial.begin(9600);    //Start serial communication at 9600bps<br />
}</em></p>
<p><em>void loop(){<br />
if (Serial.available()){  //If data is available to read,<br />
val = Serial.read();    //read it and store it as val<br />
}<br />
if (val == &#8216;H&#8217;){              //If H is recieved<br />
digitalWrite(ledPin, HIGH);  //turn ON light<br />
} else {<br />
digitalWrite(ledPin, LOW);  //If not leave light OFF<br />
}<br />
delay(25);<br />
}</em></p>
<p style="text-align: center;"><strong>Processing Code</strong><em>(Download <a title="http://serverwillprovide.com/icuubi/examples/processing/PA_lightBlink.tar" href="http://serverwillprovide.com/icuubi/examples/processing/PA_lightBlink.tar" target="_blank">here</a>)</em></p>
<p style="text-align: left;"><em>//Check if the mouse is over a rectangle and write the status to the serial port<br />
</em></p>
<p style="text-align: left;"><em>import processing.serial.*;<br />
import cc.arduino.*;</em></p>
<p style="text-align: left;"><em></em><br />
<em>Serial port;    //Create object from Serial class</em></p>
<p><em>void setup() {<br />
size(200, 200);<br />
noStroke();<br />
frameRate(10);<br />
//Open the port that the board is connected to and use the same speed (9600bps)<br />
port = new Serial(this, Serial.list()[0], 9600);<br />
}</em></p>
<p><em>void draw() {<br />
background (255);<br />
if (mouseOverRect() == true) {  //If mouse if over square<br />
fill(242, 204, 47);                    //change color<br />
port.write(&#8216;H&#8217;);              //send H to serial port<br />
} else {            //If mouse is NOT over square<br />
fill(0);          //change color<br />
port.write(&#8216;L&#8217;);  //send L to serial port<br />
}<br />
rect(50, 50, 100, 100);  //Draws the square<br />
}</em></p>
<p><em>boolean mouseOverRect() {    //Tests if mouse is over square<br />
return ((mouseX &gt;= 50) &amp;&amp; (mouseX &lt;= 150) &amp;&amp; (mouseY &gt;= 50) &amp;&amp; (mouseY &lt;= 150));<br />
}</em></p>
]]></content:encoded>
			<wfw:commentRss>http://dailyduino.com/archives/483/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Arduino &amp; Moblie Phone Communications</title>
		<link>http://dailyduino.com/archives/439</link>
		<comments>http://dailyduino.com/archives/439#comments</comments>
		<pubDate>Thu, 08 Jan 2009 19:48:02 +0000</pubDate>
		<dc:creator>Morgellon</dc:creator>
				<category><![CDATA[Communication]]></category>
		<category><![CDATA[Phone]]></category>
		<category><![CDATA[Serial]]></category>
		<category><![CDATA[Wireless]]></category>

		<guid isPermaLink="false">http://dailyduino.com/?p=439</guid>
		<description><![CDATA[For several years, I have been a user of various smart-phones of different makes and models.  Once I used my first smart-phone, I was truly hooked by the &#8220;life style&#8221;. Soon, I was left with little desire to return to a &#8220;normal&#8221; phone that &#8220;just made calls&#8221;. I am always finding new applications that remind [...]]]></description>
			<content:encoded><![CDATA[<p>For several years, I have been a user of various smart-phones of different makes and models.  Once I used my first smart-phone, I was truly hooked by the &#8220;life style&#8221;. Soon, I was left with little desire to return to a <em>&#8220;normal&#8221;</em> phone that <em>&#8220;just made calls&#8221;</em>. I am always finding new applications that remind me a smart-phone is more like a small computer that is capable of making phone calls, than just a fancy phone.</p>
<p>When I entered the world of the *duinos, I remember the question <em>&#8220;Can I hook up my Arduino to my phone?&#8221;</em> entering somewhere in the back of my mind.  There it sat, in the deep recesses of the mind&#8230;. <em><strong>until recently</strong></em>.</p>
<p>Ideally, I would like the ability to plug in or sync an Arduino and run the Arduino IDE on a mobile phone.  I have little desire to replace my computer and keyboard for a phone as my main environment.  Although, I would like the ability to use the phone as a &#8220;field unit&#8221;. Perhaps using it to edit, tweak, or update versions of a sketch without the need of a PC or laptop.</p>
<p>I have no idea if this is at all possible&#8230; but in the course of searching the internet for answers I have found some interesting projects with *duino&#8217;s and mobile phones!<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/cgZiBl7Uzdo&amp;hl=en&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/cgZiBl7Uzdo&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<ul>
<li style="text-align: center;"><strong>Here is an example of a BT Arduino communicating with a mobile phone over Blue-Tooth.</strong> http://www.youtube.com/watch?v=cgZiBl7Uzdo</li>
</ul>
<p>This example is neat, but&#8230; the blue-tooth Arduino can be pricey and I&#8217;m really looking for a way to physical connect the arduino over USB&#8230; so we keep searching&#8230;<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/mEM-VHZTqhk&amp;hl=en&amp;fs=1" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/mEM-VHZTqhk&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<ul>
<li style="text-align: center;"><strong>This example has serial output from an Arduino being displayed on an iPod Touch or iPhone. </strong>http://www.youtube.com/watch?v=mEM-VHZTqhk</li>
</ul>
<p>This example caught my eye and interest! (Possibly due to the nature of owning an iPhone&#8230;) So, I decided to poke around and see if I could find more info on the process. Most of what I found was in Japanese or broken links.</p>
<p><a href="http://d.hatena.ne.jp/tabletlet/20080328/" target="_blank">http://d.hatena.ne.jp/tabletlet/20080328/</a> The site where the video originated and the Google translation <a href="http://translate.google.com/translate?hl=en&amp;ie=UTF-8&amp;u=http%3A%2F%2Fd.hatena.ne.jp%2Ftabletlet%2F20080328%2F&amp;sl=ja&amp;tl=en&amp;history_state0=" target="_blank">http://translate.google.com/translate?hl=en&amp;ie=UTF-8&amp;u=http%3A%2F%2Fd.hatena.ne.jp%2Ftabletlet%2F20080328%2F&amp;sl=ja&amp;tl=en&amp;history_state0=</a></p>
<p><a href="http://translate.google.com/translate?hl=en&amp;ie=UTF-8&amp;u=http%3A%2F%2Fd.hatena.ne.jp%2Ftabletlet%2F20080328%2F&amp;sl=ja&amp;tl=en&amp;history_state0=" target="_blank"></a></p>
<p><a href="http://translate.google.com/translate?hl=en&amp;ie=UTF-8&amp;u=http%3A%2F%2Fd.hatena.ne.jp%2Ftabletlet%2F20080328%2F&amp;sl=ja&amp;tl=en&amp;history_state0=" target="_blank"></a><br />
<a href="http://novi.10.dtiblog.com/blog-entry-213.html" target="_blank">http://novi.10.dtiblog.com/blog-entry-213.html</a> Another site in Japanese with a bit more info on establishing the serial communications and the Google translation <a href="http://translate.google.com/translate?hl=en&amp;ie=UTF-8&amp;u=http%3A%2F%2Fnovi.10.dtiblog.com%2Fblog-entry-213.html&amp;sl=ja&amp;tl=en&amp;history_state0=" target="_blank">http://translate.google.com/translate?hl=en&amp;ie=UTF-8&amp;u=http%3A%2F%2Fnovi.10.dtiblog.com%2Fblog-entry-213.html&amp;sl=ja&amp;tl=en&amp;history_state0=</a></p>
<p><a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1207058161" target="_blank">http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1207058161</a> A post in the Arduino.cc forums about connecting Arduino to iPod/iPhone serial.</p>
<p><a href="http://devdot.wikispaces.com/Iphone+Serial+Port+Tutorial" target="_blank">http://devdot.wikispaces.com/Iphone+Serial+Port+Tutorial</a> Info about iPod/iPhone serial communications.</p>
<p><a href="http://pinouts.ru/Devices/ipod_pinout.shtml" target="_blank">http://pinouts.ru/Devices/ipod_pinout.shtml</a> iPod/iPhone connector pin-out.</p>
<p>And of course, a few sources for iPod connectors and breakout boards:</p>
<ul>
<li><a href="http://www.seeedstudio.com/depot/ipodext-assembled-version-breakout-for-ipod-p-148.html" target="_blank">http://www.seeedstudio.com/depot/ipodext-assembled-version-breakout-for-ipod-p-148.html</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=633" target="_blank">http://www.sparkfun.com/commerce/product_info.php?products_id=633</a></li>
<li><a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8295">http://www.sparkfun.com/commerce/product_info.php?products_id=8295</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dailyduino.com/archives/439/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wireless Communication Part 1</title>
		<link>http://dailyduino.com/archives/294</link>
		<comments>http://dailyduino.com/archives/294#comments</comments>
		<pubDate>Wed, 12 Nov 2008 15:07:06 +0000</pubDate>
		<dc:creator>droops</dc:creator>
				<category><![CDATA[Serial]]></category>
		<category><![CDATA[Wireless]]></category>
		<category><![CDATA[parallax]]></category>
		<category><![CDATA[rf]]></category>

		<guid isPermaLink="false">http://dailyduino.com/?p=294</guid>
		<description><![CDATA[Today we are going to be playing with some 433 mhz radios from Parallax. Transmitter $30 Receiever $40 Datasheet Now this is only going to be one way communication, as these will either transmit or recieve but not both.  This pair is extremely easy to use, they say these will range over 500ft and will [...]]]></description>
			<content:encoded><![CDATA[<p>Today we are going to be playing with some 433 mhz radios from Parallax.</p>
<p><a href="http://www.parallax.com/Store/Accessories/Communication/tabid/161/txtSearch/transmitter/List/1/ProductID/113/Default.aspx?SortField=ProductName%2cProductName">Transmitter</a> $30</p>
<p><a href="http://www.parallax.com/Store/Accessories/Communication/tabid/161/txtSearch/transmitter/List/1/ProductID/112/Default.aspx?SortField=ProductName%2cProductName">Receiever</a> $40</p>
<p><a href="http://www.parallax.com/Portals/0/Downloads/docs/prod/rf/27980-ParallaxRFTransmit-v1.0.pdf">Datasheet</a></p>
<p>Now this is only going to be one way communication, as these will either transmit or recieve but not both.  This pair is extremely easy to use, they say these will range over 500ft and <span id="dnn_ctr600_ProductPage_lblItemHtmlHolder">will speak between 12,000 &#8211; 19.2 K baud. </span></p>
<p>To use these, you simply put them inline with the wired example, on the transmitter there is a ground, power, data and  power down.  Don&#8217;t worry about the power down, you know where to plug the other 3.  Data is going to be your tx pin.</p>
<p>On the reciever there are those 4 pins and a signal pin.  This signal pin shows how strong the signal is from the transmitter.  You can read this like any other analog value.  Your data pin goes to rx.</p>
<div id="attachment_295" class="wp-caption alignnone" style="width: 310px"><a href="http://dailyduino.com/wp-content/uploads/2008/11/wireless_transmit.jpg"><img class="size-medium wp-image-295" title="wireless_transmit" src="http://dailyduino.com/wp-content/uploads/2008/11/wireless_transmit-300x198.jpg" alt="Transmitter" width="300" height="198" /></a><p class="wp-caption-text">Transmitter</p></div>
<div id="attachment_296" class="wp-caption alignnone" style="width: 310px"><a href="http://dailyduino.com/wp-content/uploads/2008/11/wireless_recieve.jpg"><img class="size-medium wp-image-296" title="wireless_recieve" src="http://dailyduino.com/wp-content/uploads/2008/11/wireless_recieve-300x200.jpg" alt="Reciever" width="300" height="200" /></a><p class="wp-caption-text">Receiver</p></div>
<div id="attachment_297" class="wp-caption alignnone" style="width: 310px"><a href="http://dailyduino.com/wp-content/uploads/2008/11/transmit_closeup.jpg"><img class="size-medium wp-image-297" title="transmit_closeup" src="http://dailyduino.com/wp-content/uploads/2008/11/transmit_closeup-300x200.jpg" alt="Transmitter Closeup" width="300" height="200" /></a><p class="wp-caption-text">Transmitter Closeup</p></div>
<div id="attachment_298" class="wp-caption alignnone" style="width: 310px"><a href="http://dailyduino.com/wp-content/uploads/2008/11/wirless_recieve_closeup.jpg"><img class="size-medium wp-image-298" title="wirless_recieve_closeup" src="http://dailyduino.com/wp-content/uploads/2008/11/wirless_recieve_closeup-300x200.jpg" alt="Receiver Closeup" width="300" height="200" /></a><p class="wp-caption-text">Receiver Closeup</p></div>
]]></content:encoded>
			<wfw:commentRss>http://dailyduino.com/archives/294/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wired Communication Between Arduinos</title>
		<link>http://dailyduino.com/archives/287</link>
		<comments>http://dailyduino.com/archives/287#comments</comments>
		<pubDate>Sat, 08 Nov 2008 22:31:10 +0000</pubDate>
		<dc:creator>droops</dc:creator>
				<category><![CDATA[LCD]]></category>
		<category><![CDATA[Serial]]></category>
		<category><![CDATA[Communication]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[sparkfun]]></category>

		<guid isPermaLink="false">http://dailyduino.com/?p=287</guid>
		<description><![CDATA[To do a wired serial conection you need 3 wires, rx, tx, ground.  Don&#8217;t forget the ground, that had me all confused and frustrated.  The tx (transmit) and rx (recieve) wires need to be crossed. I wrote a simple sketch that starts at 0, outputs that value, increments by 1, outputs that value and so [...]]]></description>
			<content:encoded><![CDATA[<p>To do a wired serial conection you need 3 wires, rx, tx, ground.  Don&#8217;t forget the ground, that had me all confused and frustrated.  The tx (transmit) and rx (recieve) wires need to be crossed.</p>
<p>I wrote a simple sketch that starts at 0, outputs that value, increments by 1, outputs that value and so on.  This sketch will be used for all of my serial communication between Arduino posts. <a href="http://dailyduino.com/code/serialcom/">code</a></p>
<div id="attachment_288" class="wp-caption alignnone" style="width: 310px"><a href="http://dailyduino.com/wp-content/uploads/2008/11/lcd.jpg"><img class="size-medium wp-image-288" title="lcd" src="http://dailyduino.com/wp-content/uploads/2008/11/lcd-300x139.jpg" alt="LCD output" width="300" height="139" /></a><p class="wp-caption-text">LCD output</p></div>
<p>So I get my sketches running, one outputting that information and the second reading it and displaying it to an LCD.</p>
<p>Then I wire everything up.</p>
<p><a href="http://dailyduino.com/wp-content/uploads/2008/11/wired.jpg"><img class="alignnone size-medium wp-image-289" title="wired" src="http://dailyduino.com/wp-content/uploads/2008/11/wired-200x300.jpg" alt="" width="200" height="300" /></a></p>
<p><a href="http://dailyduino.com/wp-content/uploads/2008/11/wired_closeup.jpg"><img class="alignnone size-medium wp-image-290" title="wired_closeup" src="http://dailyduino.com/wp-content/uploads/2008/11/wired_closeup-300x200.jpg" alt="" width="300" height="200" /></a></p>
<p>This allows tx and rx between the 2 Arduino&#8217;s dont forget the common ground.  With wireless you do not have to have that common ground, my next 2 posts will be on such things.</p>
<p><a href="http://dailyduino.com/code/serialcom/">Download the sketches I used</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dailyduino.com/archives/287/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

