<?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>Dual Elephants &#187; Arduino</title>
	<atom:link href="http://www.adebenham.com/tag/arduino/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adebenham.com</link>
	<description>Always keep a spare for redundancy</description>
	<lastBuildDate>Sun, 21 Feb 2010 22:18:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MusicXML/MIDI for Arduino</title>
		<link>http://www.adebenham.com/2010/02/musicxmlmidi-for-arduino/</link>
		<comments>http://www.adebenham.com/2010/02/musicxmlmidi-for-arduino/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 00:47:49 +0000</pubDate>
		<dc:creator>cjd</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Peggy 2]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://www.adebenham.com/?p=49</guid>
		<description><![CDATA[For a recent project I wanted to add music.
Being that I am not musically talented in any way I figured the best way to do this was to generate the music from a midi file.
To help with this I wrote a converter that would take a MusicXML file and output an include file.
It simply reads [...]]]></description>
			<content:encoded><![CDATA[<p>For a recent project I wanted to add music.</p>
<p>Being that I am not musically talented in any way I figured the best way to do this was to generate the music from a midi file.</p>
<p>To help with this I wrote a converter that would take a MusicXML file and output an include file.</p>
<p>It simply reads the XML and outputs an array where each note is stored in two uint16 values &#8211; the first is the note name as a defined in pitches.h (ie NOTE_C4), the second is the duration in milliseconds.  The entire array is stored in PROGMEM so as to not use up too much ram on the AVR.</p>
<p>The script is as follows (or download from <a href="/files/arduino/convert_xml.pl">here</a>)</p>
<pre>#!/usr/bin/perl
# Convert a single-channel musicxml file to include file for arduino
# Pass the xml filename on the commandline and a .h file will be generated
# with the same name (replacing .xml with .h)

# Needs XML::Mini perlmodule (libxml-mini-perl package in debian/ubuntu)
use XML::Mini::Document;
my $size = 0;

my $name = $ARGV[0];
$name =~ s/\.xml$//;
open(OUT, "&gt;".$name.".h");
print OUT "PROGMEM prog_uint16_t ".$name."Tune[] = {\n";

my $xmldoc = XML::Mini::Document-&gt;new();
$xmldoc-&gt;fromFile($ARGV[0]);
my $xmlHash = $xmldoc-&gt;toHash();
my $measures = $xmlHash-&gt;{'score-partwise'}-&gt;{'part'}-&gt;{'measure'};
foreach my $measure (@$measures) {
  my $notes=$measure-&gt;{'note'};
  foreach (@$notes) {
    my $note = "";
    if ($_-&gt;{'pitch'}) {
      if (defined $_-&gt;{'accidental'}) {
        if ($_-&gt;{'accidental'} eq "sharp") {
          $_-&gt;{'pitch'}-&gt;{'step'}=$_-&gt;{'pitch'}-&gt;{'step'}."S";
        } elsif ($_-&gt;{'accidental'} eq "flat") {
          $_-&gt;{'pitch'}-&gt;{'step'} =~ tr/A-F/FA-E/;
          $_-&gt;{'pitch'}-&gt;{'step'}=$_-&gt;{'pitch'}-&gt;{'step'}."S";
        }
      }
      $note = "NOTE_".$_-&gt;{'pitch'}-&gt;{'step'}.$_-&gt;{'pitch'}-&gt;{'octave'};
    } else {
      $note = "NOTE_00";
    }
    my $duration = $_-&gt;{'duration'};
    print OUT $note.", ".$duration.", ";
    $size++;
  }
  print OUT "\n";
}
print OUT "};\n";
print OUT "byte ".$name."TuneSteps = ".$size.";\n";
print "total memory usage:".(($size*4)+1)." bytes\n";
close OUT;
</pre>
<p>To actually use this generated include file I created a function &#8216;playMelody&#8217; which is called regularly during the running of a sketch.</p>
<p>Each time it runs it checks if it is time to play the next note, if so then it reads the next note from the array,calls &#8216;tone&#8217; to play it and then sets a variable to say when the next note should be played.  If it is not yet time to play the next note then it quickly returns (there is not much latency added by calling the function so it&#8217;s okay to call too often)</p>
<pre><span style="color: #cc6600;">boolean</span> playMelody()
{
  <span style="color: #cc6600;">boolean</span> retVal=<span style="color: #cc6600;">true</span>;
  <span style="color: #cc6600;">if</span> (<span style="color: #cc6600;">millis</span>() &gt; time) {
    <span style="color: #cc6600;">int</span> toneVal = 0;
    <span style="color: #cc6600;">int</span> duration = 0;
    <span style="color: #cc6600;">if</span> (tuneStep &gt;= SmoothCriminalTuneSteps) {
      retVal=<span style="color: #cc6600;">false</span>;
      tuneStep=0;
    }
    toneVal=pgm_read_word_near(SmoothCriminalTune+(tuneStep*2));
    duration = pgm_read_word_near(SmoothCriminalTune+(tuneStep*2)+1);
    tuneStep++;
    <span style="color: #cc6600;">if</span> (toneVal) <span style="color: #cc6600;">tone</span>(speakerPin,toneVal,duration*2);
    time=<span style="color: #cc6600;">millis</span>()+(duration*2)+5;
  }
  <span style="color: #cc6600;">return</span> retVal;
}
</pre>
<p>I have a sample sketch which uses this to play a short melody loop as <a href="/files/arduino/music.zip">music.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adebenham.com/2010/02/musicxmlmidi-for-arduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Peggy 2 multi-game sketch v0.2</title>
		<link>http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-2/</link>
		<comments>http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-2/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 00:28:23 +0000</pubDate>
		<dc:creator>cjd</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Peggy 2]]></category>

		<guid isPermaLink="false">http://www.adebenham.com/?p=48</guid>
		<description><![CDATA[I&#8217;ve done a lot more work on the multi-game sketch for my Peggy2 &#8211; mostly to add functionality and fix up a few &#8216;issues&#8217;
See the original post  for more details on what is included
Download it from here When compiled it uses 13808 bytes so there only a bit of room to spare.
I&#8217;ve added a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve done a lot more work on the multi-game sketch for my Peggy2 &#8211; mostly to add functionality and fix up a few &#8216;issues&#8217;<br />
See the original post <a href="http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-1/">here</a> for more details on what is included<br />
Download it from <a href="/files/arduino/peggy2_games_0.2.zip">here</a> When compiled it uses 13808 bytes so there only a bit of room to spare.<br />
I&#8217;ve added a two player version of pong (use up/down buttons to control player two &#8211; I&#8217;ve made a separate plug-in controller for player two to make things easier to use)<br />
I&#8217;ve fixed up the &#8216;breakout&#8217; clone so it actually can be considered a &#8216;game&#8217; <img src='http://www.adebenham.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
I also added a &#8216;demo&#8217; game which just lights up all leds with a nice grayscale pattern than can be moved around via the direction buttons (press select to stop the motion)<br />
The other main thing is that it now has sound!<br />
With the release of arduino-0018 they added a function &#8216;tone&#8217; to generate square waves on a digital pin. I connected a piezo speaker (from a headphone) to ADC5 and generated the tones on that pin.<br />
There is intro music at the game select screen, music when displaying the score and various bips and beeps while playing the games.<br />
To make the music I wrote a small perl script to convert MusicXML files to a suitable include file (will be documented in a separate post)<br />
Adding the music and extra games meant I was hitting the space limits in the AVR so there is a bit of &#8216;dodgyness&#8217; in the code so that it would fit.</p>
<p>See the original post <a href="http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-1/">here</a> for more details on what is included</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Peggy 2 multi-game sketch v0.1</title>
		<link>http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-1/</link>
		<comments>http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-1/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 22:26:30 +0000</pubDate>
		<dc:creator>cjd</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Peggy 2]]></category>

		<guid isPermaLink="false">http://www.adebenham.com/?p=17</guid>
		<description><![CDATA[I had such fun writing the simple &#8217;snake&#8217; game for my peggy 2 that I wrote a bunch of other games for it as well.
At the moment there is Snake, Breakout, Pong and Race.
You can download the sketch as peggy2_games_0.1.zip
When compiled it takes up 11432 bytes (it includes the &#8216;Tone&#8217; library as I have started [...]]]></description>
			<content:encoded><![CDATA[<p>I had such fun writing the simple &#8217;snake&#8217; game for my peggy 2 that I wrote a bunch of other games for it as well.</p>
<p>At the moment there is Snake, Breakout, Pong and Race.</p>
<p>You can download the sketch as <a href="/files/arduino/peggy2_games_0.1.zip">peggy2_games_0.1.zip</a></p>
<p>When compiled it takes up 11432 bytes (it includes the &#8216;Tone&#8217; library as I have started adding sound to the sketch &#8211; connect speaker to ADC5 to hear it)</p>
<h2>Starting peggy2_game</h2>
<p><a href="http://www.adebenham.com/wp-content/uploads/2010/02/game_menu.jpg"><img class="aligncenter size-full wp-image-19" title="Game menu" src="http://www.adebenham.com/wp-content/uploads/2010/02/game_menu.jpg" alt="Game menu" width="300" height="327" /></a></p>
<p>When you turn on the peggy2 a menu is presented displaying the available games &#8211; you can select from them using the up/down buttons and select with the &#8217;select&#8217; or &#8216;any&#8217; button on the left of the peggy2.  Only three game names fit on the screen at once so the entire display scrolls up/down when changing game (and highlights the current selection)  To change games press the reset button.</p>
<h2>Playing the games</h2>
<h3>Snake</h3>
<p style="text-align: center;"><a href="http://www.adebenham.com/wp-content/uploads/2010/02/snake.jpg"><img class="alignnone size-full wp-image-21" title="Snake" src="http://www.adebenham.com/wp-content/uploads/2010/02/snake.jpg" alt="Snake" width="300" height="309" /></a><a href="http://www.adebenham.com/wp-content/uploads/2010/02/level_select.jpg"><img class="alignnone size-full wp-image-20" title="Level select" src="http://www.adebenham.com/wp-content/uploads/2010/02/level_select.jpg" alt="Level select" width="300" height="307" /></a></p>
<p>When the game first starts you can choose which level to start at.  There are four different boards available &#8211; these boards are re-used in a loop just at a higher speed for later levels.</p>
<p>Eat the &#8216;apples&#8217; to get points, don&#8217;t hit yourself or walls</p>
<p>Arrow buttons control movement of the snake.</p>
<p><a href="http://www.adebenham.com/wp-content/uploads/2010/02/score.jpg"><img class="aligncenter size-full wp-image-22" title="Score screen" src="http://www.adebenham.com/wp-content/uploads/2010/02/score.jpg" alt="Score screen" width="300" height="299" /></a></p>
<h3>Pong</h3>
<p><a href="http://www.adebenham.com/wp-content/uploads/2010/02/pong.jpg"><img class="aligncenter size-full wp-image-23" title="Pong game" src="http://www.adebenham.com/wp-content/uploads/2010/02/pong.jpg" alt="Pong game" width="300" height="292" /></a></p>
<p>Hit the ball back, get a point if the AI misses, AI gets the point if you miss</p>
<p>Left/right buttons control movement of the bottom paddle (one player only for the moment)</p>
<h3>Break</h3>
<p><a href="http://www.adebenham.com/wp-content/uploads/2010/02/break.jpg"><img class="aligncenter size-full wp-image-24" title="Breakout game" src="http://www.adebenham.com/wp-content/uploads/2010/02/break.jpg" alt="Breakout game" width="300" height="284" /></a></p>
<p>Not much here yet, just displays a bouncing ball + blocks to hit</p>
<p>Left/right buttons control movement of the paddle</p>
<h3>Race</h3>
<p><a href="http://www.adebenham.com/wp-content/uploads/2010/02/race.jpg"><img class="aligncenter size-full wp-image-25" title="Race game" src="http://www.adebenham.com/wp-content/uploads/2010/02/race.jpg" alt="Race game" width="300" height="280" /></a></p>
<p>Avoid the walls.  One point every 25 blocks driven past, walls get narrower every 25 points</p>
<p>Left/right buttons control movement of the car.</p>
<p>peggy2_games.zip</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Peggy 2 Character display</title>
		<link>http://www.adebenham.com/2010/01/peggy-2-character-display/</link>
		<comments>http://www.adebenham.com/2010/01/peggy-2-character-display/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 03:48:31 +0000</pubDate>
		<dc:creator>cjd</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Peggy 2]]></category>

		<guid isPermaLink="false">http://www.adebenham.com/?p=15</guid>
		<description><![CDATA[As mentioned in the  post I wrote a bunch of small utility functions to display a string on the peggy 2.
Each character is stored as a 24-bit number (held in a 32bit uint32) where each 4 bits indicates the on/off status for a row of 4 pixels. This results in allowing for a 4&#215;6 pixel [...]]]></description>
			<content:encoded><![CDATA[<p>As mentioned in the <a href="http://www.adebenham.com/2010/01/peggy-2-snake/">Peggy 2 Snake</a> post I wrote a bunch of small utility functions to display a string on the peggy 2.</p>
<p>Each character is stored as a 24-bit number (held in a 32bit uint32) where each 4 bits indicates the on/off status for a row of 4 pixels. This results in allowing for a 4&#215;6 pixel character</p>
<p>For example the character for the number &#8216;0&#8242; is stored as 0&#215;699996 which when spread out looks like:</p>
<pre>0<strong>11</strong>0
<strong>1</strong>00<strong>1</strong>
<strong>1</strong>00<strong>1</strong>
<strong>1</strong>00<strong>1</strong>
<strong>1</strong>00<strong>1</strong>
0<strong>11</strong>0</pre>
<p>By doing this I can store 0-9 and A-Z in only 144bytes.<br />
To save RAM I put this in program memory using: PROGMEM prog_uint32_t chars[37] ﻿</p>
<p>To write a character to the display I use a function &#8220;show_char&#8221; (note I use a special function &#8217;setPixel&#8217; to set the individual pixels to a certain brightness level &#8211; but if you are not using grayscale then the call can be replaced by standard frame.SetPixel calls)</p>
<pre>void show_char(char Character, byte x, byte y)
{
  byte charNum = 36;
  if ((Character &gt;= '0') &amp;&amp; (Character &lt;= '9')) {
    charNum=Character-48;
  }
  if ((Character &gt;= 'A') &amp;&amp; (Character &lt;= 'Z')) {
    charNum=Character-55;
  }
  unsigned long w;
  w = pgm_read_dword_near(chars + charNum);
  for (byte i=0; i&lt;6; i++) {
    byte offset = 4*(5-i);
    byte b = w &gt;&gt; offset; // get four bits
    b=b &amp; 0xF;
    if (b &amp; B1000) setPixel(x,y+i,7);
    if (b &amp; B0100) setPixel(x+1,y+i,7);
    if (b &amp; B0010) setPixel(x+2,y+i,7);
    if (b &amp; B0001) setPixel(x+3,y+i,7);
  }
}
</pre>
<p>To make things a bit easier to display a string I also created a quick wrapper function &#8216;write_string&#8217;</p>
<pre>void write_string(char string[], byte x, byte y)
{
  byte i=0;
  while (string[i] != '\0') {
    show_char(string[i], x+(5*i), y);
    i++;
  }
}
</pre>
<p>Full usage/source can be found in the peggy 2 snake code</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adebenham.com/2010/01/peggy-2-character-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Peggy 2 Snake</title>
		<link>http://www.adebenham.com/2010/01/peggy-2-snake/</link>
		<comments>http://www.adebenham.com/2010/01/peggy-2-snake/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 03:32:30 +0000</pubDate>
		<dc:creator>cjd</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Peggy 2]]></category>

		<guid isPermaLink="false">http://www.adebenham.com/?p=13</guid>
		<description><![CDATA[For Christmas my wife gave me a peggy 2 and I finally got around to building it.
It has 24&#215;25 White LEDs with a row of 25 Red LEDs across the bottom.
By having that bottom row a different colour I can use that section for displaying score or other information
The first application I wrote for it [...]]]></description>
			<content:encoded><![CDATA[<p>For Christmas my wife gave me a <a href="http://evilmadscience.com/tinykitlist/75">peggy 2</a> and I finally got around to building it.</p>
<div id="attachment_14" class="wp-caption aligncenter" style="width: 209px"><a href="http://www.adebenham.com/wp-content/uploads/2010/01/Peggy2_snake.jpg"><img class="size-medium wp-image-14" title="Peggy2_snake" src="http://www.adebenham.com/wp-content/uploads/2010/01/Peggy2_snake-199x300.jpg" alt="Peggy 2 running Snake" width="199" height="300" /></a><p class="wp-caption-text">Peggy 2 running Snake</p></div>
<p>It has 24&#215;25 White LEDs with a row of 25 Red LEDs across the bottom.</p>
<p>By having that bottom row a different colour I can use that section for displaying score or other information</p>
<p>The first application I wrote for it the good old game of &#8216;Snake&#8217;.  After writing a quick version of the game I realised it needed a bit more &#8216;flair&#8217; and so added the ability to display an intro screen and score screen.  To make this easier I wrote a bunch of utility functions to display characters that are stored in an array. I&#8217;ll describe how this works in a separate post as <a href="http://www.adebenham.com/2010/01/peggy-2-character-display/">Peggy 2 Character display</a>.</p>
<p>The game has multiple levels (where walls are put up in different spots and the speed is increased).  All up the program takes up 5258 bytes so fits on an atmega168 with room to spare.</p>
<p>Source code is available as <a href="/files/arduino/peggy2_snake.zip">peggy2_snake.zip</a></p>
<p>If you don&#8217;t have all the leds soldered on you can change gameMinX, gameMaxX, gameMinY, gameMaxY and score* to set the area used to play/display score</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adebenham.com/2010/01/peggy-2-snake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino controlled lights &#8211; The Hardware</title>
		<link>http://www.adebenham.com/2009/03/arduino-controlled-lights-the-hardware/</link>
		<comments>http://www.adebenham.com/2009/03/arduino-controlled-lights-the-hardware/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 06:53:09 +0000</pubDate>
		<dc:creator>cjd</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Christmas Lights]]></category>

		<guid isPermaLink="false">http://www.adebenham.com/blog/?p=5</guid>
		<description><![CDATA[
Okay &#8211; now that I have a box it is time to wire it all up.
After playing around with various methods of switching I settled on a bunch of solid-state relays connected to the arduino.
The advantage of solid-state relays over mechanical onese are that they switched quicker, are less likely to arc and don&#8217;t require [...]]]></description>
			<content:encoded><![CDATA[<p>
Okay &#8211; now that I have a box it is time to wire it all up.</p>
<p>After playing around with various methods of switching I settled on a bunch of solid-state relays connected to the arduino.</p>
<p>The advantage of solid-state relays over mechanical onese are that they switched quicker, are less likely to arc and don&#8217;t require any additional components to up the voltage in order to throw them.&nbsp; I ended up with a bunch of FSS1-102Z relays which can be bought from jaycar for about $12 each as part SY4088.</p>
<p>These relays can switch 250VAC happily with only a 5V switch current.&nbsp; This means I could wire them straight to the arduino.</p>
<div align="center"><a href="http://www.flickr.com/photos/74003126@N00/3385977271/"><img width="377" height="251" src="http://farm4.static.flickr.com/3585/3385977271_cc4c2ce5d5.jpg?v=0" /></a></div>
<p>Power comes into the box from the side goes to two distribution blocks.</p>
<p>One block splits the earth (green) and neutral (blue) lines into three sets with one set going to the internal powerpoint (used to power the arduino plugpack) and the other two sets going up the left and right columns of power points.&nbsp; Each powerpoint is linked to the one above it which helped to keep the wiring minimal and tidy.</p>
<p>The other, much larger, block provides a bunch of points for connecting the live (brown) wires.&nbsp; From here power is sent to the internal powerpoint and one live wire to each row of powerpoints.</p>
<p align="center"><a href="http://www.flickr.com/photos/74003126@N00/3385978447/"><img width="323" height="219" src="http://farm4.static.flickr.com/3653/3385978447_3e92029953.jpg?v=0" /></a></p>
<p>The live wires go up to each row and are split in two at the<br />
last moment to each connect to one point on the load side of a relay.&nbsp;<br />
The other point on the load side of the relay connects to the live plug<br />
on the powerpoint.</p>
<p>On the input side of the relays the negatives are all linked together and head down to ground on the arduino.</p>
<p> The positives are kept separate and go down to the digital outputs on the arduino.</p>
<p align="center"><a href="http://www.flickr.com/photos/74003126@N00/3385977905/"><img width="252" height="169" src="http://farm4.static.flickr.com/3586/3385977905_41a08b25ae.jpg?v=0" /></a></p>
<p align="left">To make things a bit easier for testing I soldered each of the incoming lines to a row of pin headers.&nbsp; This means I can quickly unplug/plug in the lines to the arduino in case I need to use it elsewhere.&nbsp; It also helps to keep them in order <img src='http://www.adebenham.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Because this box is running 240V I added a small 240v light to the top of the box that is lit up whenever the box has power (even if the arduino is not running)&nbsp; This just serves as a little warning.</p>
<p align="left">The final result is seen below</p>
<p align="center"><a href="http://www.flickr.com/photos/74003126@N00/3385976651/"><img src="http://farm4.static.flickr.com/3459/3385976651_1f79b55ba8.jpg?v=0" /></a></p>
<p>Next up &#8211; the software! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.adebenham.com/2009/03/arduino-controlled-lights-the-hardware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino controlled lights &#8211; The Box</title>
		<link>http://www.adebenham.com/2009/03/arduino-controlled-lights-the-box/</link>
		<comments>http://www.adebenham.com/2009/03/arduino-controlled-lights-the-box/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 10:46:51 +0000</pubDate>
		<dc:creator>cjd</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Christmas Lights]]></category>

		<guid isPermaLink="false">http://www.adebenham.com/blog/?p=6</guid>
		<description><![CDATA[The aim was to start with 10 outlets and build out from there.
To make things easier I decided to make a box with room for 10 standard 240V wall powerpoints.
Each powerpoint is 117&#215;70mm so allowing for two columns of five points (with space between each to allow for plugpacks)I ended up with a base of [...]]]></description>
			<content:encoded><![CDATA[<p>The aim was to start with 10 outlets and build out from there.</p>
<p>To make things easier I decided to make a box with room for 10 standard 240V wall powerpoints.</p>
<p>Each powerpoint is 117&#215;70mm so allowing for two columns of five points (with space between each to allow for plugpacks)I ended up with a base of 250&#215;460mm.&nbsp; I ended up making the box 220mm deep so that it wouldn&#8217;t fall over (the exact dimension was mostly determined by the size of the piece of wood I had)</p>
<p>In the end I needed the following cuts:</p>
<ul>
<li> 2 * 250&#215;460 for front/back</li>
<li>2 * 220&#215;460 for sides</li>
<li>2 * 250&#215;210 for top/bottom</li>
</ul>
<p>I cut the sides out of a sheet of melamine MDF and assembled by connecting with small right-angle brackets.&nbsp; I then finished it up by applying some melamine lining to the exposed wood for aestetics.&nbsp; The back panel was attached by a large hinge and a small handle was added.</p>
<p>Here is the final result:</p>
<p> <a href="http://www.flickr.com/photos/74003126@N00/3385976155/"><img src="http://farm4.static.flickr.com/3644/3385976155_24fe88d5c0.jpg?v=0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adebenham.com/2009/03/arduino-controlled-lights-the-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino controlled lights</title>
		<link>http://www.adebenham.com/2009/03/arduino-controlled-lights/</link>
		<comments>http://www.adebenham.com/2009/03/arduino-controlled-lights/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 10:12:33 +0000</pubDate>
		<dc:creator>cjd</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Christmas Lights]]></category>

		<guid isPermaLink="false">http://www.adebenham.com/blog/?p=7</guid>
		<description><![CDATA[Last Christmas was my first Christmas in my very own house (was renting before) and so I was able to put up more lights than before.&#160; In the process of setting up the lights I thought about making them computer controlled (so as to sync to music etc)
I had some X10 appliance modules which did [...]]]></description>
			<content:encoded><![CDATA[<p>Last Christmas was my first Christmas in my very own house (was renting before) and so I was able to put up more lights than before.&nbsp; In the process of setting up the lights I thought about making them computer controlled (so as to sync to music etc)</p>
<p>I had some X10 appliance modules which did the job for turning them on/off at the right times of day, but there was so much lag that I couldn&#8217;t use it for anything fancy.&nbsp; As such I started looking around for how to do this properly.&nbsp; Most of the stuff I found was only available in the US and/or was very expensive so I figured I&#8217;d just do it myself <img src='http://www.adebenham.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>To that end for Christmas my wife bought me an <a href="http://arduino.cc">Arduino</a> and various little bits.&nbsp; I then spent a while learning how to program it.&nbsp; Then after a bit more time I began work on an arduino controlled power box.&nbsp; At long last I have finished it (hardware-wise &#8211; better software is still to come)</p>
<p>So that others may get some benefit from my testing I figured I&#8217;d blog how I made it. I&#8217;ll split the build up into a few posts for easier digestion &#8211; The box, the hardware and finally the software.</p>
<p>Here goes nothing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adebenham.com/2009/03/arduino-controlled-lights/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
