<?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>Seb Lee-Delisle &#187; Arduino</title>
	<atom:link href="http://sebleedelisle.com/category/arduino/feed/" rel="self" type="application/rss+xml" />
	<link>http://sebleedelisle.com</link>
	<description>Actionscript Games, Physics and Papervision3D</description>
	<lastBuildDate>Sat, 31 Jul 2010 15:41:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Arduino workshop at FlashCoders New York on Wednesday</title>
		<link>http://sebleedelisle.com/2008/03/arduino-workshop-at-flashcoders-new-york-on-wednesday/</link>
		<comments>http://sebleedelisle.com/2008/03/arduino-workshop-at-flashcoders-new-york-on-wednesday/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 13:16:40 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Speaking]]></category>

		<guid isPermaLink="false">http://www.sebleedelisle.com/?p=171</guid>
		<description><![CDATA[I&#8217;m flying with fellow Plug-in Media colleagues Juliet and Sarah to New York on Tuesday to meet with clients that I&#8217;m not sure I&#8217;m allowed to talk about&#8230; but we&#8217;re producing some cool Flash 3D for a massive US sports company&#8230; seriously exciting work so watch this space for more details. And I&#8217;m taking the [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2008/03/arduino-particles/' rel='bookmark' title='Permanent Link: Arduino particles!'>Arduino particles!</a></li>
<li><a href='http://sebleedelisle.com/2010/02/more-training-courses-in-cologne-minneapolis-new-york-and-san-francisco/' rel='bookmark' title='Permanent Link: More training courses in Cologne, Minneapolis, New York and San Francisco'>More training courses in Cologne, Minneapolis, New York and San Francisco</a></li>
<li><a href='http://sebleedelisle.com/2009/10/usa-euro-invasion-countdown-begins/' rel='bookmark' title='Permanent Link: USA Euro-invasion countdown begins'>USA Euro-invasion countdown begins</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2008%252F03%252Farduino-workshop-at-flashcoders-new-york-on-wednesday%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Arduino%20workshop%20at%20FlashCoders%20New%20York%20on%20Wednesday%20%23%22%20%7D);"></div>
<p><a href="http://www.flickr.com/photos/sebleedelisle/1467832987/" title="P1000596.JPG by sebleedelisle, on Flickr"><img src="http://farm2.static.flickr.com/1148/1467832987_2e69ebb2ba.jpg" width="500" height="375" alt="P1000596.JPG" /></a></p>
<p>I&#8217;m flying with fellow <a href="http://www.pluginmedia.net">Plug-in Media</a> colleagues Juliet and Sarah to New York on Tuesday to meet with clients that I&#8217;m not sure I&#8217;m allowed to talk about&#8230; but we&#8217;re producing some cool Flash 3D for a <em>massive</em> US sports company&#8230; seriously exciting work so watch this space for more details.</p>
<p>And I&#8217;m taking the opportunity to meet up with my good friends (and the inspiration for <a href="http://flashbrighton.org">FlashBrighton</a>) at <a href="http://flashcodersny.org">FlashCodersNY</a> where I&#8217;ll be sharing <a href="http://www.sebleedelisle.com/?p=170">my new found love</a> of the <a href="http://www.arduino.cc">Arduino</a>.</p>
<p>If you&#8217;re in the area, it&#8217;d be great to see you! <a href="http://www.flashcodersny.org/wordpress/?p=149">More details about my Arduino workshop with FlashcodersNY here.</a></p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2008/03/arduino-particles/' rel='bookmark' title='Permanent Link: Arduino particles!'>Arduino particles!</a></li>
<li><a href='http://sebleedelisle.com/2010/02/more-training-courses-in-cologne-minneapolis-new-york-and-san-francisco/' rel='bookmark' title='Permanent Link: More training courses in Cologne, Minneapolis, New York and San Francisco'>More training courses in Cologne, Minneapolis, New York and San Francisco</a></li>
<li><a href='http://sebleedelisle.com/2009/10/usa-euro-invasion-countdown-begins/' rel='bookmark' title='Permanent Link: USA Euro-invasion countdown begins'>USA Euro-invasion countdown begins</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2008/03/arduino-workshop-at-flashcoders-new-york-on-wednesday/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Arduino particles!</title>
		<link>http://sebleedelisle.com/2008/03/arduino-particles/</link>
		<comments>http://sebleedelisle.com/2008/03/arduino-particles/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 00:49:10 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Particles]]></category>

		<guid isPermaLink="false">http://www.sebleedelisle.com/?p=170</guid>
		<description><![CDATA[My good friend and FlashBrighton veteran Jo Summers has been enthusing at me for some time about the Arduino boards. And I just knew that as soon as I started playing with one, I would get obsessed, so I&#8217;ve been putting it off for a while. I knew you could use Arduinos to interface with [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2008/03/arduino-workshop-at-flashcoders-new-york-on-wednesday/' rel='bookmark' title='Permanent Link: Arduino workshop at FlashCoders New York on Wednesday'>Arduino workshop at FlashCoders New York on Wednesday</a></li>
<li><a href='http://sebleedelisle.com/2006/10/moviecliptransformmatrix-experiments/' rel='bookmark' title='Permanent Link: MovieClip.transform.matrix experiments&#8230;'>MovieClip.transform.matrix experiments&#8230;</a></li>
<li><a href='http://sebleedelisle.com/2007/06/flash-particles-now-1000-extra-free/' rel='bookmark' title='Permanent Link: Flash Particles &#8211; now 1000% extra free!'>Flash Particles &#8211; now 1000% extra free!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2008%252F03%252Farduino-particles%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Arduino%20particles%21%20%23%22%20%7D);"></div>
<p>My good friend and <a href="http://flashbrighton.org">FlashBrighton</a> veteran <a href="http://www.profaniti.com/blog/">Jo Summers</a> has been enthusing at me for some time about the <a href="http://www.arduino.cc/">Arduino</a> boards. And I just knew that as soon as I started playing with one, I would get obsessed, so I&#8217;ve been putting it off for a while.</p>
<p>I knew you could use Arduinos to interface with the computer, and Flash. But what I didn&#8217;t quite register was that you could program these little chips <em>independently of the computer!</em> Once you program them, you can disconnect them and (as long as you give them a power supply) they will continue to do exactly what you want them to do! So actually I haven&#8217;t done any work getting them working with Flash at all, I&#8217;ve been much more interested in getting them to work independently.</p>
<p>And 2 weeks later, in true predictable seb-style, I&#8217;ve made a particle system on the Arduino. I know. I&#8217;m sorry.</p>
<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/ShieUa2tjWc"></param><embed src="http://www.youtube.com/v/ShieUa2tjWc" type="application/x-shockwave-flash" width="425" height="350"></embed></object></p>
<p>It all started when we decided to give away 8 workshop kits at the recent FlashBrighton Flex3 launch event, (<a href="http://aralbalkan.com/1243">which appears to have started</a> <a href="http://iestyn.net/wp/2008/03/23/etch-a-sketch-using-flash-and-arduino/">a mini Brighton epidemic</a>), and I knew I could put off my hardware tinkering no longer.</p>
<p>I love LEDs, or light emitting diodes. You know the little red lights you get in stuff? Ever since I started playing with electronics as a kid &#8211; my dad was a physics lecturer and he used to bring home components for me to play with. So naturally the first thing I started playing with was LEDs.</p>
<p>But the arduino only has 13 outputs, so you can only control 13 LEDs? Well that&#8217;s cool, but it&#8217;s not cool enough. So I started looking into alternatives. And I discovered Charlieplexing! You can read all about <a href="http://www.instructables.com/id/Charlieplexing-LEDs--The-theory/">charlieplexing here on the instructables site</a> &#8211; it&#8217;s a complicated way of wiring LEDs that enables you to control many with few connections, and with only 6 outputs, you can control 30 LEDs!</p>
<p><a href="http://flickr.com/photos/adactio/2337918119/"><img src="http://farm4.static.flickr.com/3221/2337918119_0b7afb77a3.jpg" alt="Charlieplexing some LEDs courtesy of Jeremy Keith" /></a> (Photo by <a href="http://adactio.com/journal/1425/">Jeremy Keith</a>)</p>
<p>And that was cool for a while, but not enough. My need for LEDs was not going to be satisfied. So then I borrowed one of these cool <a href="http://80.189.97.157/Products/displays/bxxcdm.htm">8 x 8 LED matrices</a> from <a href="http://nexusmachines.com">Nexus</a>.</p>
<p>Once I figured out how to wire it up, and using the <a href="http://wiring.org.co/reference/libraries/Matrix/index.html">Arduino Matrix library</a>, I got to work.</p>
<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/C8EoXiYto3E&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/C8EoXiYto3E&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
<p>The only real trick here is that I&#8217;m working internally with a much higher resolution that the actual 8&#215;8 grid, and then rounding to the nearest pixel when displaying each particle. This gives a really smooth movement. I&#8217;m only actually lighting one LED per particle but due to the Persistence of Vision (POV) effect it looks like there are more. And the final trick is to add a diffuser. It&#8217;s kinda like a hardware blur filter <img src='http://sebleedelisle.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  It really tricks the eye into seeing the separate particles.</p>
<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/nkF4phpV6YU"></param><embed src="http://www.youtube.com/v/nkF4phpV6YU" type="application/x-shockwave-flash" width="425" height="350"></embed></object></p>
<p><span id="more-170"></span></p>
<p>The code&#8217;s a bit hacky, but it&#8217;s just a prototype. I&#8217;ll explain it in more detail later if you&#8217;re interested! I just wanted to get this up before I went to sleep. Code below&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">#include <span style="color: #339933;">&lt;</span>binary.<span style="color: #006633;">h</span><span style="color: #339933;">&gt;</span>
#include <span style="color: #339933;">&lt;</span>sprite.<span style="color: #006633;">h</span><span style="color: #339933;">&gt;</span>
#include <span style="color: #339933;">&lt;</span>matrix.<span style="color: #006633;">h</span><span style="color: #339933;">&gt;</span>
&nbsp;
Matrix myMatrix <span style="color: #339933;">=</span> Matrix<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">13</span>,<span style="color: #cc66cc;">11</span>,<span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">const</span> <span style="color: #000066; font-weight: bold;">int</span> numparticles <span style="color: #339933;">=</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000066; font-weight: bold;">int</span> velx<span style="color: #009900;">&#91;</span>numparticles<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> vely<span style="color: #009900;">&#91;</span>numparticles<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">long</span> posx<span style="color: #009900;">&#91;</span>numparticles<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">long</span> posy<span style="color: #009900;">&#91;</span>numparticles<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">int</span> res <span style="color: #339933;">=</span> <span style="color: #cc66cc;">7</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> maxnum <span style="color: #339933;">=</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">&lt;&lt;</span>res<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> maxspeed <span style="color: #339933;">=</span> <span style="color: #cc66cc;">30</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> count <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">int</span> row<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> col<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">;</span>
&nbsp;
&nbsp;
  myMatrix.<span style="color: #006633;">setBrightness</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">15</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>numparticles<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    velx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> random<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span>
    vely<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> random<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span>
    posx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">%</span>2<span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;&lt;</span>res<span style="color: #339933;">;</span>
    posy<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;&lt;</span>res<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  myMatrix.<span style="color: #006633;">clear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// clear display</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>numparticles<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
&nbsp;
    row <span style="color: #339933;">=</span> posx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;&gt;</span>res<span style="color: #339933;">;</span>
    col <span style="color: #339933;">=</span> posy<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;&gt;</span>res<span style="color: #339933;">;</span>
    myMatrix.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>row, col, HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
    posx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">+=</span>velx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    posy<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">+=</span>vely<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>posx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      posx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
      velx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">=-</span>velx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>posx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;=</span>maxnum<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      posx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> maxnum<span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span>maxnum<span style="color: #339933;">-</span>posx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      velx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> <span style="color: #339933;">-</span>velx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      vely<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> vely<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>random<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>vely<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span>maxspeed<span style="color: #009900;">&#41;</span> vely<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> maxspeed<span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>vely<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">&lt;-</span>maxspeed<span style="color: #009900;">&#41;</span> vely<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #339933;">-</span>maxspeed<span style="color: #339933;">;</span>
&nbsp;
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>posy<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      posy<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
      vely<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">=-</span>vely<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>posy<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;=</span>maxnum<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      posy<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> maxnum<span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span>maxnum<span style="color: #339933;">-</span>posy<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      vely<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">=-</span>vely<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      velx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> velx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>random<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>velx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span>maxspeed<span style="color: #009900;">&#41;</span> velx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> maxspeed<span style="color: #339933;">;</span>
      <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>velx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">&lt;-</span>maxspeed<span style="color: #009900;">&#41;</span> velx<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #339933;">-</span>maxspeed<span style="color: #339933;">;</span>
&nbsp;
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #009900;">&#125;</span>
  delay<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>




<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2008/03/arduino-workshop-at-flashcoders-new-york-on-wednesday/' rel='bookmark' title='Permanent Link: Arduino workshop at FlashCoders New York on Wednesday'>Arduino workshop at FlashCoders New York on Wednesday</a></li>
<li><a href='http://sebleedelisle.com/2006/10/moviecliptransformmatrix-experiments/' rel='bookmark' title='Permanent Link: MovieClip.transform.matrix experiments&#8230;'>MovieClip.transform.matrix experiments&#8230;</a></li>
<li><a href='http://sebleedelisle.com/2007/06/flash-particles-now-1000-extra-free/' rel='bookmark' title='Permanent Link: Flash Particles &#8211; now 1000% extra free!'>Flash Particles &#8211; now 1000% extra free!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2008/03/arduino-particles/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
