<?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>iestyn.net &#187; arduino</title>
	<atom:link href="http://www.iestyn.net/wp/category/arduino/feed" rel="self" type="application/rss+xml" />
	<link>http://www.iestyn.net/wp</link>
	<description>"the concrete world is starting to get ya."</description>
	<lastBuildDate>Fri, 21 Oct 2011 16:27:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Arduino + Flash + Wii Nunchuck + Servos + Webcam. Part 1</title>
		<link>http://www.iestyn.net/wp/2009/03/29/arduino-flash-wii-nunchuck-servos-webcam-part-1</link>
		<comments>http://www.iestyn.net/wp/2009/03/29/arduino-flash-wii-nunchuck-servos-webcam-part-1#comments</comments>
		<pubDate>Sun, 29 Mar 2009 18:25:13 +0000</pubDate>
		<dc:creator>Iestyn</dc:creator>
				<category><![CDATA[Servos]]></category>
		<category><![CDATA[Wii]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[nunchuck]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.iestyn.net/wp/?p=200</guid>
		<description><![CDATA[Here&#8217;s part of what I&#8217;ve been working on over the last few days.
The Wii Nunchuck is connected to my Arduino using I2C.
For now, the webcam is just a standard webcam with the housing removed, and connected via USB.
It uses  hacked up code from here and here.
(If you want to make something like this, Making Things [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s part of what I&#8217;ve been working on over the last few days.</p>
<p>The Wii Nunchuck is connected to my Arduino using <a href="http://www.arduino.cc/playground/Learning/I2C" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.arduino.cc/playground/Learning/I2C');">I2C</a>.</p>
<p>For now, the webcam is just a standard webcam with the housing removed, and connected via USB.</p>
<p>It uses  hacked up code from <a href="http://www.windmeadow.com/node/42" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.windmeadow.com/node/42');">here</a> and <a href="http://auav.blogspot.com/2007/12/wii-nunchuck-control.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://auav.blogspot.com/2007/12/wii-nunchuck-control.html');">here.</a></p>
<p>(If you want to make something like this, <a href="http://www.amazon.co.uk/gp/product/0596510519?ie=UTF8&amp;tag=iestynnet-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0596510519" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.amazon.co.uk/gp/product/0596510519?ie=UTF8&amp;tag=iestynnet-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0596510519');">Making Things Talk</a> is an outstanding book.)</p>
<p>Here&#8217;s a sample video:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" 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/phcsDNOglLI&amp;hl=en&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/phcsDNOglLI&amp;hl=en&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><span style="color: #ff0000;">[update]</span>: Hello <a href="http://hackaday.com/2009/03/30/arduino-wii-nunchuck-servos/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://hackaday.com/2009/03/30/arduino-wii-nunchuck-servos/');">Hack a Day people!</a> <img src='http://www.iestyn.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="color: #ff0000;">[update]</span>: <a href="http://hackaday.com/2009/03/30/arduino-wii-nunchuck-servos/#comment-68589" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://hackaday.com/2009/03/30/arduino-wii-nunchuck-servos/#comment-68589');">As Dokument says</a>, <a href="http://www.youtube.com/watch?v=MD_-YnFZFP8" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.youtube.com/watch?v=MD_-YnFZFP8');">here&#8217;s an almost identical setup</a> created long before I did this.</p>
<p><span style="color: #ff0000;">[update]</span>: If you don&#8217;t want to cut the end off your Wii Nunchuck,<a href="http://blog.makezine.com/archive/2008/02/wiichuck_wii_nunchuck_ada.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://blog.makezine.com/archive/2008/02/wiichuck_wii_nunchuck_ada.html');"> you can buy one of these</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iestyn.net/wp/2009/03/29/arduino-flash-wii-nunchuck-servos-webcam-part-1/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Arduino Mega</title>
		<link>http://www.iestyn.net/wp/2009/03/27/arduino-mega</link>
		<comments>http://www.iestyn.net/wp/2009/03/27/arduino-mega#comments</comments>
		<pubDate>Fri, 27 Mar 2009 13:42:43 +0000</pubDate>
		<dc:creator>Iestyn</dc:creator>
				<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://www.iestyn.net/wp/?p=179</guid>
		<description><![CDATA[Just as I start getting back into electronic hackery, they go and release the Arduino Mega!
I&#8217;ve not come close to exceeding the capacity of my Arduino Diecimila, so perhaps I&#8217;ll wait a while until getting this, but.. I want! 

Cool Components are selling them for £49 + VAT
]]></description>
			<content:encoded><![CDATA[<p>Just as I start getting back into electronic hackery, they go and release the <a href="http://arduino.cc/en/Main/ArduinoBoardMega" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://arduino.cc/en/Main/ArduinoBoardMega');">Arduino Mega!</a></p>
<p>I&#8217;ve not come close to exceeding the capacity of my Arduino Diecimila, so perhaps I&#8217;ll wait a while until getting this, but.. I want! </p>
<p><a href="http://arduino.cc/en/Main/ArduinoBoardMega" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://arduino.cc/en/Main/ArduinoBoardMega');"><img class="alignnone size-full wp-image-180" title="Arduino Mega" src="http://www.iestyn.net/wp/wp-content/uploads/2009/03/arduinomega.jpg" alt="Arduino Mega" width="480" height="250" /></a></p>
<p><a href="http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=23_35&amp;products_id=262" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=23_35&amp;products_id=262');">Cool Components are selling them for £49 + VAT</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iestyn.net/wp/2009/03/27/arduino-mega/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino, Wii, Flash, Servos, Lasers, Papervision..</title>
		<link>http://www.iestyn.net/wp/2009/03/27/arduino-wii-flash-servos-lasers-papervision</link>
		<comments>http://www.iestyn.net/wp/2009/03/27/arduino-wii-flash-servos-lasers-papervision#comments</comments>
		<pubDate>Fri, 27 Mar 2009 13:22:30 +0000</pubDate>
		<dc:creator>Iestyn</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[brighton]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Lasers]]></category>
		<category><![CDATA[papervision]]></category>
		<category><![CDATA[pv3d]]></category>
		<category><![CDATA[Servos]]></category>
		<category><![CDATA[Wii]]></category>

		<guid isPermaLink="false">http://www.iestyn.net/wp/?p=167</guid>
		<description><![CDATA[Recently I&#8217;ve been getting into all things electronic again. Strangely, I was doing this a year ago. 
Creating the Shopper 13 game sparked my enthusiasm, and I&#8217;ve been gathering new parts to experiment with:
 
In addition to that, I&#8217;ve also got a Wii Nunchuck hooked up to my Arduino which I&#8217;m currently controlling Flash and Servos [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been getting into all things electronic again. Strangely, <a href="http://www.iestyn.net/wp/2008/03/24/flash-papervision-3d-arduino" >I was doing this a year ago</a>. </p>
<p>Creating <a href="http://www.iestyn.net/wp/2009/03/27/wallace-and-gromit-science-museum" >the Shopper 13 game </a>sparked my enthusiasm, and I&#8217;ve been gathering new parts to experiment with:<br />
<a title="Servos and header pins by yezzer, on Flickr" href="http://www.flickr.com/photos/yezzer/3381405995/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.flickr.com/photos/yezzer/3381405995/');"><img src="http://farm4.static.flickr.com/3439/3381405995_0399a2dd98_m.jpg" alt="Servos and header pins" width="240" height="180" /></a> <a title="Making things talk by yezzer, on Flickr" href="http://www.flickr.com/photos/yezzer/3389926664/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.flickr.com/photos/yezzer/3389926664/');"><img src="http://farm4.static.flickr.com/3611/3389926664_b49c3afb9d_m.jpg" alt="Making things talk" width="180" height="240" /></a></p>
<p>In addition to that, I&#8217;ve also got a Wii Nunchuck hooked up to my Arduino which I&#8217;m currently controlling Flash and Servos via the accelerometer and analog joystick. Oh, and a Laser.. and some Papervision too. When I&#8217;ve got something interesting, I&#8217;ll post it. Hopefully that&#8217;ll be in the next few days <img src='http://www.iestyn.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Well I have to start building my robot army somewhere..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iestyn.net/wp/2009/03/27/arduino-wii-flash-servos-lasers-papervision/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash + Papervision 3D + Arduino</title>
		<link>http://www.iestyn.net/wp/2008/03/24/flash-papervision-3d-arduino</link>
		<comments>http://www.iestyn.net/wp/2008/03/24/flash-papervision-3d-arduino#comments</comments>
		<pubDate>Sun, 23 Mar 2008 23:02:17 +0000</pubDate>
		<dc:creator>Iestyn</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[brighton]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[papervision]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://iestyn.net/wp/2008/03/24/flash-papervision-3d-arduino/</guid>
		<description><![CDATA[In my second little project today, I modified the circuit I built for the Flash etch-a-sketch, by adding another potentiometer and 3 LEDs, each of which represents the voltage of each pot (using pulse-width modulation to &#8216;dim&#8217; the LED).
Each pot is responsible for either the pitch, yaw, or roll of a cube in PV3D.
Simple stuff [...]]]></description>
			<content:encoded><![CDATA[<p>In my second little project today, I modified the circuit I built for the <a href="http://iestyn.net/wp/2008/03/23/etch-a-sketch-using-flash-and-arduino/" >Flash etch-a-sketch</a>, by adding another potentiometer and 3 LEDs, each of which represents the voltage of each pot (using pulse-width modulation to &#8216;dim&#8217; the LED).</p>
<p>Each pot is responsible for either the pitch, yaw, or roll of a cube in PV3D.</p>
<p>Simple stuff that&#8217;s been done before! I think I need to think of something a bit more interesting now <img src='http://www.iestyn.net/wp/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><a title="Flash + Papervision 3D + Arduino by yezzer, on Flickr" href="http://www.flickr.com/photos/yezzer/2356130182/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.flickr.com/photos/yezzer/2356130182/');"><img src="http://farm3.static.flickr.com/2318/2356130182_9fc3e72dba.jpg" alt="Flash + Papervision 3D + Arduino" width="375" height="500" /></a></p>
<p><a title="Flash + Papervision 3D + Arduino by yezzer, on Flickr" href="http://www.flickr.com/photos/yezzer/2356129866/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.flickr.com/photos/yezzer/2356129866/');"><img src="http://farm3.static.flickr.com/2385/2356129866_26bb0e0ebf.jpg" alt="Flash + Papervision 3D + Arduino" width="500" height="375" /></a></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/yiPBIMnRGxo" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/yiPBIMnRGxo"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iestyn.net/wp/2008/03/24/flash-papervision-3d-arduino/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Etch-a-sketch using Flash and Arduino</title>
		<link>http://www.iestyn.net/wp/2008/03/23/etch-a-sketch-using-flash-and-arduino</link>
		<comments>http://www.iestyn.net/wp/2008/03/23/etch-a-sketch-using-flash-and-arduino#comments</comments>
		<pubDate>Sun, 23 Mar 2008 16:49:47 +0000</pubDate>
		<dc:creator>Iestyn</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[brighton]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[game]]></category>

		<guid isPermaLink="false">http://iestyn.net/wp/2008/03/23/etch-a-sketch-using-flash-and-arduino/</guid>
		<description><![CDATA[Well, I had nothing much better to do today, so after sorting out my previous problems with Arduino and Flash, I thought i&#8217;d connect 2 potentiometers to the Arduino board, and make&#8230;.. Yezzer-sketch!
Here&#8217;s the on-screen result:

The very simple circuit:

Video:

I need to get some better potentiometers, these are pretty rubbish.
Yey for making &#8230; stuff!  
]]></description>
			<content:encoded><![CDATA[<p>Well, I had nothing much better to do today, so after sorting out my previous problems with Arduino and Flash, I thought i&#8217;d connect 2 potentiometers to the Arduino board, and make&#8230;.. Yezzer-sketch!</p>
<p>Here&#8217;s the on-screen result:<br />
<a href="http://www.flickr.com/photos/yezzer/2354291159/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.flickr.com/photos/yezzer/2354291159/');" title="Yezzer - sketch. Using Flash + Arduino by yezzer, on Flickr"><img src="http://farm3.static.flickr.com/2062/2354291159_a0381fa851.jpg" width="500" height="375" alt="Yezzer - sketch. Using Flash + Arduino" /></a></p>
<p>The very simple circuit:<br />
<a href="http://www.flickr.com/photos/yezzer/2355120866/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.flickr.com/photos/yezzer/2355120866/');" title="Yezzer - sketch. Using Flash + Arduino by yezzer, on Flickr"><img src="http://farm3.static.flickr.com/2036/2355120866_ae02140090.jpg" width="375" height="500" alt="Yezzer - sketch. Using Flash + Arduino" /></a></p>
<p>Video:<br />
<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/vGdaDMFCtmM&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/vGdaDMFCtmM&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
<p>I need to get some better potentiometers, these are pretty rubbish.</p>
<p>Yey for making &#8230; stuff! <img src='http://www.iestyn.net/wp/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.iestyn.net/wp/2008/03/23/etch-a-sketch-using-flash-and-arduino/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Getting Flash and Arduino talking, and problems with AS3</title>
		<link>http://www.iestyn.net/wp/2008/03/23/getting-flash-and-arduino-talking-and-problems-with-as3</link>
		<comments>http://www.iestyn.net/wp/2008/03/23/getting-flash-and-arduino-talking-and-problems-with-as3#comments</comments>
		<pubDate>Sun, 23 Mar 2008 12:48:39 +0000</pubDate>
		<dc:creator>Iestyn</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[brighton]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://iestyn.net/wp/2008/03/23/getting-flash-and-arduino-talking-and-problems-with-as3/</guid>
		<description><![CDATA[Over the last year, i&#8217;ve heard a lot about Arduino, so I was quite gutted when I missed out on both the Arduino talk at BarcampBrighton2, and also on the Arduino session a few days later at FlashBrighton!
Nevertheless, I had to get an Arduino board and start experimenting. Jo had a few Arduino boards, so [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last year, i&#8217;ve heard a lot about Arduino, so I was quite gutted when I missed out on both the Arduino talk at BarcampBrighton2, and also on the Arduino session a few days later at FlashBrighton!<br />
Nevertheless, I had to get an Arduino board and start experimenting. <a href="http://www.profaniti.com/blog/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.profaniti.com/blog/');">Jo</a> had a few Arduino boards, so kindly dropped one round for me.</p>
<p>For me, the most interesting aspect is using the Arduino in conjunction with Flash, sending and recieiving data betwen the two. I realy like the <a href="http://www.flickr.com/photos/quasimondo/2304868954/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.flickr.com/photos/quasimondo/2304868954/');">twitter > flash > arduino > LCD display</a> that Mario made. I found it quite inspirational.</p>
<p>Getting Flash and the Arduino talking is initially very, very easy. It takes no time at all to initially write your first &#8220;hello world&#8221; app &#8211; in this case a blinking LED. After that, I turned my attention to reading the output of a potentiometer, and display that in Flash. Again, this is very easy, espically when people have done it already, and you can copy and paste their code! Thanks <a href="http://www.progetto25zero1.com/b/tools/Arduino/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.progetto25zero1.com/b/tools/Arduino/');">Beltran</a>, <a href="http://blog.thestem.ca/archives/77" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://blog.thestem.ca/archives/77');">Brett</a>, and <a href="http://aralbalkan.com/1243" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://aralbalkan.com/1243');">Aral</a> for sharing your code!<br />
In no time I had a potentiometer controlling the brightness of an LED, and the Arduino writing the data to the serial port, which Flash was trace()ing to the output window.</p>
<p>Nothing&#8217;s that easy though, right? Indeed. I&#8217;m expecting values between 0 and 1023, and specifically in this instance, around 1023. This is what I got:</p>
<blockquote><p>
15:37:53:104 = 102<br />
15:37:53:135 = 3<br />
15:37:54:104 = 1023<br />
15:37:55:119 = 1023<br />
15:37:56:135 = 1023<br />
15:37:57:119 = 102<br />
15:37:57:135 = 3<br />
15:37:58:119 = 1023<br />
15:37:59:135 = 1023<br />
15:38:0:151 = 1023<br />
15:38:1:135 = 10<br />
15:38:1:151 = 23<br />
15:38:2:151 = 1023
</p></blockquote>
<p>How strange. As you can see, occasionally the output is split over more than one line. It also does the same on my laptop.<br />
After a lot of hair-pulling, I&#8217;ve made a couple of examples, which you can test if you wish. You&#8217;ll need to change the port to the one serproxy (or equivalent) is set up to use.</p>
<p><strong>Arduino code:</strong><br />
[code]<br />
void setup()<br />
{<br />
  Serial.begin(9600);<br />
}</p>
<p>void loop()<br />
{<br />
  Serial.println("hello");<br />
  delay(100);<br />
}<br />
[/code]</p>
<p><strong>Actionscript 3 code:</strong><br />
[code]<br />
import flash.events.*;<br />
import flash.net.Socket;</p>
<p>trace("__AS3 Example__");<br />
var socket:Socket = new Socket("localhost",5335);<br />
socket.addEventListener(ProgressEvent.SOCKET_DATA, socketDataHandler);<br />
function socketDataHandler(event:ProgressEvent):void {<br />
    var now = new Date();<br />
    trace(now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+":"+now.getMilliseconds()+" = "+socket.readUTFBytes(socket.bytesAvailable));<br />
}<br />
[/code]</p>
<p><strong>Actionscript 2 code:</strong><br />
[code]<br />
trace("__AS2 Example__");<br />
var socket:XMLSocket = new XMLSocket();<br />
socket.connect("localhost",5335);<br />
socket.onData = function (data) {<br />
    var now = new Date();<br />
    trace(now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+":"+now.getMilliseconds()+" = "+data);<br />
}</p>
<p>[/code]</p>
<p><strong>AS3 Output:</strong></p>
<blockquote><p>
12:10:43:140 = hello</p>
<p>12:10:43:234 = hel<br />
12:10:43:250 = lo</p>
<p>12:10:43:359 = hello</p>
<p>12:10:43:453 = h<br />
12:10:43:453 = ello</p>
<p>12:10:43:562 = hello
</p></blockquote>
<p><strong>AS2 Output:</strong></p>
<blockquote><p>
12:11:25:406 = hello</p>
<p>12:11:25:515 = hello</p>
<p>12:11:25:625 = hello</p>
<p>12:11:25:718 = hello</p>
<p>12:11:25:812 = hello</p>
<p>12:11:25:921 = hello
</p></blockquote>
<p>AS3 has odd output, and AS2 has the expected output. It&#8217;s almost as if ProgressEvent.SOCKET_DATA is called too frequently?<br />
I&#8217;ve looked at <a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1170939903" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1170939903');">this, which may be a similar problem</a>. Here&#8217;s my <a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206201268" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206201268');">post on the Arduino forum</a> which I wrote as I experienced the problem.</p>
<p>In the end I found <a href="http://code.google.com/p/as3glue/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://code.google.com/p/as3glue/');">AS3Glue</a>, which &#8220;is an ActionScript 3 library that enables communication between Flash/Flex/AIR applications and Arduino boards&#8221;. This changes the way in which AS3 and the Arduino communicate, and fortunately <strong>solves the problem described above.</strong></p>
<p>If you use AS3glue, you&#8217;ll also need to use the <a href="http://www.arduino.cc/playground/Interfacing/Firmata" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.arduino.cc/playground/Interfacing/Firmata');">Arduino Firmata firmware</a>. The firmware page also briefly mentions:</p>
<blockquote><p>
It turns out that the USB-serial drivers are optimized for fast bulk data transfer, and those optimizations actually wreak havoc with the timing of the messages over the USB-serial.
</p></blockquote>
<p>Perhaps that&#8217;s the problem i&#8217;ve experienced? If I can, i&#8217;d like to find out exactly what&#8217;s going on, but for now, as3glue will suffice <img src='http://www.iestyn.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
If you can, please have a test and let me know if you get the same output!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iestyn.net/wp/2008/03/23/getting-flash-and-arduino-talking-and-problems-with-as3/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

