<?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>uRaNGaTaNG &#187; buton</title>
	<atom:link href="http://www.rngtng.com/tag/buton/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rngtng.com</link>
	<description>Featuring Ruby, Rails, Web development, Arduino, Processing, Nabaztag and more...</description>
	<lastBuildDate>Thu, 12 Jan 2012 10:08:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://www.rngtng.com/?pushpress=hub'/>
		<item>
		<title>My first Arduion test: 10 LEDs running light</title>
		<link>http://www.rngtng.com/2009/04/24/my-first-arduion-test-10-leds-running-light/</link>
		<comments>http://www.rngtng.com/2009/04/24/my-first-arduion-test-10-leds-running-light/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 19:05:19 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Arduino & Co.]]></category>
		<category><![CDATA[buton]]></category>
		<category><![CDATA[interrupt]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[running]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=73</guid>
		<description><![CDATA[Check this out: 


That my first proper Arduino test, controlling a 10 LED running light. I attached a small button via interrupt as well to start &#38; stop the light. More to come soon, stay tuned!

Here the (very,very ugly) source code:

]]></description>
			<content:encoded><![CDATA[<p>Check this out:<br />
<p><a href="http://www.rngtng.com/2009/04/24/my-first-arduion-test-10-leds-running-light/"><em>Click here to view the embedded video.</em></a></p></p>
<p>That my first proper Arduino test, controlling a 10 LED running light. I attached a small button via interrupt as well to start &amp; stop the light. More to come soon, stay tuned!</p>
<p>Here the (very,very ugly) source code:</p>
<pre class="brush: cpp; title: ; notranslate">
int ledPin = 3;      // First LED connected to digital pin 13
volatile int stop = LOW;

void setup()
{
  Serial.begin(38400);
  for( int i = 0; i &lt; 10; i++) {
     pinMode(ledPin + i, OUTPUT);
  }
   attachInterrupt(0, stopit, RISING);    //Button attached to Pin 2
}

int i = 0;
void loop()
{
    for( i = 0; i &lt; 7 &amp;&amp; !stop; i++) {
      blink(ledPin + i);
    }
    for( i; i &gt;= 1 &amp;&amp; !stop; i--) {
      blink(ledPin + i);
    }
    for( i = 0; i &lt; 10 &amp;&amp; !stop; i++) {
      blink(ledPin + i);
    }
    for( i; i &gt;= 3 &amp;&amp; !stop; i--) {
      blink(ledPin + i);
    }
    for( i; i &lt; 10 &amp;&amp; !stop; i++) {
      blink(ledPin + i);
    }
    for( i = 9; i &gt;= 1 &amp;&amp; !stop; i--) {
      blink(ledPin + i);
    }
}

void stopit()
{
  delayMicroseconds(1000);
  stop = !stop;
}

void blink( int pin ) {
      digitalWrite(pin, HIGH);
      delay(120 - abs( pin - 8 ) * 20);
      digitalWrite(pin, LOW);
}
</pre>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2009/04/24/my-first-arduion-test-10-leds-running-light/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

