<?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>Psychic Origami</title>
	<atom:link href="http://www.psychicorigami.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.psychicorigami.com</link>
	<description>folding with my brain</description>
	<lastBuildDate>Sat, 17 Jul 2010 09:15:47 +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>Kite Physics</title>
		<link>http://www.psychicorigami.com/2010/07/16/kite-physics/</link>
		<comments>http://www.psychicorigami.com/2010/07/16/kite-physics/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 22:35:01 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.psychicorigami.com/?p=324</guid>
		<description><![CDATA[I&#8217;ve finally managed to finish the Kite Physics Demo I started back in October: Kite Physics Demo It&#8217;s more of a plaything than anything else. It did give me a chance to try out writing some physics code again, something I don&#8217;t get much of a chance to do during web development. Though of course [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally managed to finish the Kite Physics Demo I started <a href="http://www.psychicorigami.com/2009/10/03/kite-physics-demo/">back in October</a>:</p>
<p><center><br />
<a href="http://www.psychicorigami.com/kite/"><img class="alignnone size-full wp-image-325" title="kite physics" src="http://www.psychicorigami.com/wp-content/uploads/2010/07/kite-physics.jpg" alt="" width="480" height="480" /><br />
Kite Physics Demo<br />
</a><br />
</center></p>
<p>It&#8217;s more of a plaything than anything else.  It did give me a chance to try out writing some physics code again, something I don&#8217;t get much of a chance to do during web development.  Though of course advances in Javascript speed and the <a href="https://developer.mozilla.org/en/canvas_tutorial">Canvas tag</a> may change that in the future.</p>
<p>Originally I made use of the keyboard to control the figure and the kite, but I switched to using the mouse as it makes interacting with the scene more pleasing.  There&#8217;s a certain joy to being able to grab the kite to move it around or shift the wind direction by nudging a cloud.</p>
<p>It&#8217;s all written in Java, using <a href="http://maven.apache.org/">maven</a> to build and package.  The code is available in my <a href="http://github.com/lilspikey/kite">kite repo on guthub</a>.</p>
<p>There&#8217;s about one third of a physics engine in the code.  There&#8217;s no real collision detection for example.  Most of the physics code is for handling constraints and basic forces.  For the constraints I made use of the Gauss-Seidel technique, as outlined in <a href="http://www.teknikus.dk/tj/gdc2001.htm">Advanced Character Physics by Thomas Jakobsen</a>.  This was quite a revelation to me.  Previously I&#8217;d experimented with <a href="http://chrishecker.com/Rigid_Body_Dynamics">rigid body dynamics</a> (see my <a href="http://littlespikeyland.com/racinggame/">2D racing game</a> circa 2001), but the Gauss-Seidel method seemed much more intuitive.  I found it much easier to think of bodies made up of points connected by lines.  The &#8220;physics&#8221; naturally emerges from the way the bodies are then constructed.</p>
<p>The core physics code (in the <code>com.psychicorigami.physics.*</code> package) is fairly well structured.  There a bit of compiler placation to (theoretically) allow for the same code to work for 2D and 3D physics.  I&#8217;ve only actually implemented the 2D side of things, but have tried to use generics to make room for 3D too.  When everything is points and lines, moving from 2D to 3D is not that tricky.  Whereas for rigid body dynamics this can mean quite a big change in representation.</p>
<p>The code in the default package is used for the specifics of the demo itself, so is a bit messy really.  Lots of tweaking and prodding was needed to get things how I wanted.</p>
<p>The physics for the kite and wind interaction were aided massively by this <a href="http://www.grc.nasa.gov/WWW/K-12/airplane/kitefor.html">guide to forces on a kite</a>.  Particularly useful for understanding how to tweak the rigging, centre of gravity and centre of pressure of the kite to make it behave in a pleasing &#8211; if not entirely realistic &#8211; manner.</p>
<p>At some point I hope to revisit the physics code here.  I&#8217;ve always had a wish to create something like <a href="http://www.karlsims.com/">Karl Sims</a> &#8220;blocky creatures&#8221;, but lacked the specific technical knowledge.  Know that I have a technique for simulating complex constraints in an intuitive manner maybe I&#8217;ll manage it yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.psychicorigami.com/2010/07/16/kite-physics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>watch-cp.py</title>
		<link>http://www.psychicorigami.com/2010/07/06/watch-cp-py/</link>
		<comments>http://www.psychicorigami.com/2010/07/06/watch-cp-py/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 20:53:42 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.psychicorigami.com/?p=315</guid>
		<description><![CDATA[During software development it&#8217;s key to minimize the time between editing code and seeing the results of a change. During web-development the constant tweaking of CSS/HTML/Javascript etc means you&#8217;re always reloading the browser to see changes. At work I do a lot of Java web development, which normally involves compiling code, packaging into a .war [...]]]></description>
			<content:encoded><![CDATA[<p>During software development it&#8217;s key to minimize the time between editing code and seeing the results of a change.  During web-development the constant tweaking of CSS/HTML/Javascript etc means you&#8217;re always reloading the browser to see changes.</p>
<p>At work I do a lot of Java web development, which normally involves compiling code, packaging into a .war file and deploying it to <a href="http://tomcat.apache.org/">Tomcat</a> (running locally).  I make use of the <a href="http://mojo.codehaus.org/tomcat-maven-plugin/">maven tomcat plugin</a>, so it&#8217;s just a case of calling <code>maven tomcat:redeploy</code>.  However it still takes tens of seconds (or more if there are tests to run).  For quick tweaks of css it&#8217;s nice to be able to short-circuit this process.</p>
<p>Tomcat unpacks the .war file to another directory after the app has been deployed.  All the .jsp pages, css and javascript files can be edited in this directory and changes can be seen immediately.  However getting into the habit of editing these files within this directory is usually a bad idea, as the files will get overwritten at the next deployment.</p>
<p>We&#8217;ve been using <a href="http://compass-style.org/">compass</a> lately for css and it has a handy command:</p>
<pre>
<code>
    compass watch
</code>
</pre>
<p>That monitors .sass files for changes, then re-compiles them to css as they change, so you can see changes quickly (without needing to manually run compass each time).</p>
<p>So I thought I could do something similar for the editable files within the war file.  So I created <a href="http://gist.github.com/379197">watch-cp.py</a>.  It simply monitors a set of files and/or directories for changes and copies over files that have changed to a source file or directory.  To provide a bit of feedback it prints out when it spots a changed file, but beyond that it&#8217;s pretty brute-force in it&#8217;s approach.</p>
<p><code>watch-cp.py</code> works in a very similar way to the <code>cp</code> command, but without as many options.  For example:</p>
<pre>
<code>
    # recursively copy files from src/main/webapp to tomcat
    watch-cp.py -r src/main/webapp/* ~/tomcat/webapps/mywebapp
</code>
</pre>
<p>This is great as it means I can edit my sass files, have them compiled to css by compass, then copied over to tomcat without needing to intervene.  It takes a second sometimes, but it&#8217;s fast enough for the most part.</p>
<p>Feel free to fork the <a href="http://gist.github.com/379197">gist of watch-cp.py</a> on github.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.psychicorigami.com/2010/07/06/watch-cp-py/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone Brighton Buses webapp/javascript front-end</title>
		<link>http://www.psychicorigami.com/2010/07/04/iphone-brighton-buses-webappjavascript-front-end/</link>
		<comments>http://www.psychicorigami.com/2010/07/04/iphone-brighton-buses-webappjavascript-front-end/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 19:23:37 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.psychicorigami.com/?p=285</guid>
		<description><![CDATA[Here in Brighton a good number of the bus stops have electronic boards, that tell you when the next buses are due. The data for these boards is available online and even provides data for stops that don&#8217;t have the electronic boards. In fact there&#8217;s an free iPhone app available, so you can get the [...]]]></description>
			<content:encoded><![CDATA[<p>Here in Brighton a good number of the bus stops have electronic boards, that tell you when the next buses are due.  The data for these boards is <a href="http://buses.co.uk/">available online</a> and even provides data for stops that don&#8217;t have the electronic boards.  In fact there&#8217;s an <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=323501858&#038;mt=8">free iPhone app</a> available, so you can get the data easily on the move.</p>
<p><center><br />
<a href="http://www.flickr.com/photos/lilspikey/4743549060/" title="Brighton Station (Stop B) by lilspikey, on Flickr"><img src="http://farm5.static.flickr.com/4123/4743549060_97a885c3cc.jpg" width="500" height="375" alt="Brighton Station (Stop B)"></a><br />
</center></p>
<p>After playing around with <a href="http://www.psychicorigami.com/2009/07/10/an-iphone-friendly-local-storage-backed-offline-todo-list-webapp/">iPhone javascript apps</a>, I thought it would be interesting to try and create a javascript app for the bus times.  I had some specific ideas about how I wanted the app to work.  I was also keen on trying out some more &#8220;HTML 5&#8243; tech.  Plus I do like things to be (at least in principle) cross-platform, so this has a chance of working ok on <a href="http://www.android.com/">Android</a> phones (though I&#8217;ve not tested it on one).</p>
<p>There are still a few rough edges, but you can try out the app yourself at:</p>
<ul>
<li><a href="http://buses.psychicorigami.com/">http://buses.psychicorigami.com/</a></li>
</ul>
<p>It will prompt you to add a stop.  If you type in the text field, you&#8217;ll get a list of stops that match.  If your browser supports geo-location, you&#8217;ll also see a &#8220;Find nearby&#8221; button, which will list the nearest few stops.</p>
<p>I had the pleasure of demoing this app at the <a href="http://asyncjs.com/showntell/">Async Javascript show&#8217;n'tell</a> last month.  I quickly outlined how it worked, which involves the following:</p>
<ul>
<li><a href="http://developer.apple.com/safari/library/documentation/iphone/conceptual/safarijsdatabaseguide/OfflineApplicationCache/OfflineApplicationCache.html">Offline App Cache</a> &#8211; to make startup quick (key when you don&#8217;t want to miss your bus)</li>
<li><a href="https://developer.mozilla.org/en/dom/storage">Client-side Local Storage</a> &#8211; to record which bus stops you add</li>
<li><a href="http://www.w3.org/TR/geolocation-API/">Geo-location</a> &#8211; so you can find nearby stops</li>
<li><a href="http://jquery.com/">JQuery</a> &#8211; for front end</li>
<li><a href="http://bottle.paws.de/">Bottle.py</a> &#8211; for back end</li>
<li><a href="http://www.crummy.com/software/BeautifulSoup/">BeautifulSoup</a> &#8211; for scraping bus times</li>
</ul>
<h3>Getting the data</h3>
<p>The buses.co.uk site has an API, which I used to scrape all of the bus stops in Brighton.  I chose to scrape the update data from the website itself though, as I couldn&#8217;t get the API to give me the combined services for each stop (so you can see when the next 7 and 81 are coming for example). There are typically two stops for each name &#8211; one either side of the road.  The updates are for both directions, so I actually merged the stops together &#8211; which makes searching easier.</p>
<p>All of the stop data was stored in a single <a href="http://www.sqlite.org/">SQLite</a> database &#8211; mostly for convenience.  The database is used in a read-only method in the actual running app.  I&#8217;m sure I could use something a bit better, particularly when it comes to the distance queries.  Currently, as there are a relatively small number of stops I&#8217;m using a brute force method to find the nearest stops, but I&#8217;m sure with the use of a proper <a href="http://en.wikipedia.org/wiki/Spatial_index">spatial index</a> this could be done a lot more efficiently.  If this was scaled up to work for all stops in the UK, then that would be a necessity.</p>
<h3>Geo-location</h3>
<p>Initially the geo-location was pretty straightforward &#8211; I simply used the <code> getCurrentPosition</code> function and I got a latitude and longitude back.  Testing in Firefox and Safari on the mac gave fairly reasonable results.  However on the iPhone itself I started to notice it wasn&#8217;t very accurate.  Sometimes it was out by several 100 metres, meaning that stops I was standing next to were sometimes not showing up at all!  I had noticed, in the past, that the built-in map app sometimes has a bit of &#8220;lag&#8221; in getting an accurate position.  So I switched to using <code> watchPosition</code> and polling for the position for several seconds.  This worked pretty well, as the initial result would only be vaguely in the right place and then after a few seconds the position would become more accurate and the listing of nearby stops would start to look more sensible.</p>
<h3>Look and feel</h3>
<p>Originally I&#8217;d planned to mimic the look and feel of the iPhone&#8217;s built-in weather app.  The app is built around a similar concept &#8211; you search for bus stops and add them to a list of stops that you can flick through.  I tried to get a nice animated sliding action working, but kept on running into trouble on the device itself.  In Safari and Firefox the animation all worked ok, but I suspect there&#8217;s an issue on the iPhone when you are dragging an area that limits redrawing.  In the end I had to ditch the flip/swipe gesture too &#8211; interfering with the touch events again seemed to cause some rendering issues on occasion.  So instead simply clicking on the left or right of the timetable moves between pages.  It&#8217;s a slightly less complicated way of doing things, so there&#8217;s less that can go wrong really.</p>
<p><center><br />
<a href="http://www.flickr.com/photos/lilspikey/2720488882/" title="Old Brighton No. 5 Bus by lilspikey, on Flickr"><img src="http://farm4.static.flickr.com/3255/2720488882_d425545223.jpg" width="500" height="375" alt="Old Brighton No. 5 Bus"></a><br />
</center></p>
<h3>Deployment</h3>
<p>As this was a nice simple app (on the back-end at least), I decided to take a little time to create a <a href="http://docs.fabfile.org/">Fabric</a> file to control deployment.  The app is hosted on Webfaction, where I have already setup key-based login for ssh.  The app is deployed using <a href="http://code.google.com/p/modwsgi/">mod_wsgi</a> with a daemon process, so that one merely needs to copy over the new code, then &#8220;touch&#8221; the .wsgi file restart the daemon process.  Not exactly tricky to do, but making it a one-button process saves making any mistakes.</p>
<p>To trigger the deployment I run <a href="http://github.com/lilspikey/buses/blob/master/fabfile.py">my fab file</a> like this:</p>
<pre>
<code>
fab --user=lilspikey --hosts=lilspikey.webfactional.com deploy:webapps/buses/app/
</code>
</pre>
<p>I actually have that in a shell script, that isn&#8217;t checked into git, so that the deployment specific username, host name and remote directory aren&#8217;t checked into source control.  If I wasn&#8217;t using key-based login, I&#8217;d need to specify a password and I definitely wouldn&#8217;t want to check that into git!</p>
<h3>Source code</h3>
<p>You can get the source code on github in my <a href="http://github.com/lilspikey/buses">buses repository</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.psychicorigami.com/2010/07/04/iphone-brighton-buses-webappjavascript-front-end/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Chumby to Arduino communication using PySerial</title>
		<link>http://www.psychicorigami.com/2010/06/26/chumby-to-arduino-communication-using-pyserial/</link>
		<comments>http://www.psychicorigami.com/2010/06/26/chumby-to-arduino-communication-using-pyserial/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 20:52:03 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[chumby]]></category>

		<guid isPermaLink="false">http://www.psychicorigami.com/?p=278</guid>
		<description><![CDATA[So here are a few notes on getting a Chumby to talk to an Arduino using PySerial (and Python). It&#8217;s pretty easy, but I&#8217;ll document it to make it obvious. As the Chumby is sometimes a bit slow with a few of these steps, it&#8217;s good to know it will work in the end. First [...]]]></description>
			<content:encoded><![CDATA[<p>So here are a few notes on getting a <a href="http://www.chumby.com/">Chumby</a> to talk to an <a href="http://www.arduino.cc/">Arduino</a> using <a href="http://pyserial.sourceforge.net/">PySerial</a> (and <a href="http://www.python.org/">Python</a>).  It&#8217;s pretty easy, but I&#8217;ll document it to make it obvious.  As the Chumby is sometimes a bit slow with a few of these steps, it&#8217;s good to know it will work in the end.</p>
<p>First you&#8217;ll want <a href="http://wiki.chumby.com/mediawiki/index.php/Python">Python on the Chumby</a>.  At the time the latest version already compiled for the Chumby is Python 2.6, so it&#8217;s pretty up-to-date.</p>
<p>Once you&#8217;ve got Python installed and on a USB stick you&#8217;ll also want to download PySerial &#8211; I picked the latest version <a href="http://sourceforge.net/projects/pyserial/files/pyserial/2.5-rc2/pyserial-2.5-rc2.tar.gz/download">PySerial-2.5-rc2</a>.</p>
<p>With PySerial expanded and on the USB stick (alongside Python) you&#8217;ll want to put the USB stick in the Chumby and connect to it <a href="http://wiki.chumby.com/mediawiki/index.php/Chumby_tricks#Hidden_screen_in_Control_Panel">via SSH</a>.</p>
<p>Change to the directory for the USB stick (e.g. <code>cd /mnt/usb</code>).</p>
<p>You should see (at least) two directories, one for Python and one for PySerial:</p>
<pre>
<code>
chumby:/mnt/usb-EC5C-3D0A# ls -l
drwxr-xr-x    6 root     root         4096 Jun 26 21:15 pyserial-2.5-rc2
drwxrwxrwx    4 root     root         4096 Jan 10 13:51 python2.6-chumby
</code>
</pre>
<p>You&#8217;re first instinct may be to try and install PySerial via the usual call to <code>python setup.py install</code>.  However this appears not to work.</p>
<p>All is not lost though &#8211; just manually copy the relevant directory (serial) from PySerial to the python site-packages directory, e.g.:</p>
<pre>
<code>
cp -r pyserial-2.5-rc2/serial python2.6-chumby/lib/python2.6/site-packages/
</code>
</pre>
<p>Know to check that&#8217;s worked open a python prompt and try to import the serial library:</p>
<pre>
<code>
chumby:/mnt/usb-EC5C-3D0A# python2.6-chumby/bin/python
Python 2.6.2 (r262:71600, May 23 2009, 22:28:43)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>>
</code>
</pre>
<p>If you don&#8217;t see any errors (as above) then everything has installed ok.</p>
<p>Next step is to try out connecting an Arduino.</p>
<p>So first off you&#8217;ll want to ensure the Arduino has a program that can read from the serial port &#8211; to show that everything is working ok.  In my case I picked my <a href="http://www.psychicorigami.com/2010/05/26/my-first-arduino-project-morse-code/">Morse Code program</a>.  This will read bytes from the serial port and toggle the built-in LED (on pin 13), so it&#8217;s handy for verifying the serial port is working.</p>
<p>So now you have a program loaded on the Arduino, connect it to the Chumby.  The Arduino should get enough power from the Chumby to start up ok.</p>
<p>You need to work out which serial port the Arduino is using on the Chumby.  List the tty&#8217;s in /dev and pick the most likely looking one (should have USB in it&#8217;s name):</p>
<pre>
<code>
chumby:/mnt/usb-EC5C-3D0A# ls /dev/tty*
/dev/tty      /dev/ttyS00   /dev/ttyS02   /dev/ttyS1    /dev/ttyS3
/dev/ttyS0    /dev/ttyS01   /dev/ttyS03   /dev/ttyS2    /dev/ttyUSB0
</code>
</pre>
<p>On my Chumby the serial port was <code>/dev/ttyUSB0</code>.</p>
<p>Now open up a python prompt again and try talking to the Arduino.  You&#8217;ll need to configure the baud-rate of the serial port to match the program on the Chumby.  In my case this was 9600.</p>
<pre>
<code>

chumby:/mnt/usb-EC5C-3D0A# python2.6-chumby/bin/python
Python 2.6.2 (r262:71600, May 23 2009, 22:28:43)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>> ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1)
>>> ser.write('sos')
3
</code>
</pre>
<p>If you are using the same morse code program you should see the LED blink out &#8216;DOT-DOT-DOT DASH-DASH-DASH DOT-DOT-DOT&#8217; &#8211; confirming that the serial port works.</p>
<p>This is really quite handy, as the Chumby is a small low-power Linux server.  Coupled with Python this means it&#8217;s really easy to get any Arduino based project online, without needing a &#8220;normal&#8221; computer constantly running.  Not quite as self-contained as using an <a href="http://www.arduino.cc/en/Main/ArduinoEthernetShield">Ethernet Shield</a>, but the Chumby is fairly small, so it and an Arduino will easily sit on a window ledge (for example).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.psychicorigami.com/2010/06/26/chumby-to-arduino-communication-using-pyserial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Tone Generator/&#8221;Theremin&#8221;</title>
		<link>http://www.psychicorigami.com/2010/06/13/arduino-tone-generatortheremin/</link>
		<comments>http://www.psychicorigami.com/2010/06/13/arduino-tone-generatortheremin/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 10:26:54 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.psychicorigami.com/?p=274</guid>
		<description><![CDATA[So here&#8217;s another quick Arduino project. It is a &#8220;theremin&#8221; of sorts, but whereas a real theremin uses antennas to control pitch and volume this on uses a potentiometer for pitch and a push button for volume. The tone is output via a piezo buzzer (as used for generating morse tones in the previous project). [...]]]></description>
			<content:encoded><![CDATA[<p>So here&#8217;s another quick <a href="http://www.arduino.cc/">Arduino</a> project.  It is a &#8220;<a href="http://en.wikipedia.org/wiki/Theremin">theremin</a>&#8221; of sorts, but whereas a real theremin uses antennas to control pitch and volume this on uses a <a href="http://www.arduino.cc/en/Tutorial/Potentiometer">potentiometer</a> for pitch and a <a href="http://www.arduino.cc/en/Tutorial/Pushbutton">push button</a> for volume.  The tone is output via a piezo buzzer (as used for <a href="http://www.psychicorigami.com/2010/05/26/my-first-arduino-project-morse-code/">generating morse tones</a> in the previous project).</p>
<p><center><br />
<a href="http://www.flickr.com/photos/lilspikey/4695187823/" title="Arduino &quot;Theremin&quot; by lilspikey, on Flickr"><img src="http://farm5.static.flickr.com/4056/4695187823_bc1738d170.jpg" width="500" height="375" alt="Arduino &quot;Theremin&quot;" /></a><br />
</center></p>
<p>The voltage from the potentiometer is read via <a href="http://www.arduino.cc/en/Reference/AnalogRead">analogRead</a>, then is mapped to a freqency to output on the buzzer.  To make things sound nicer the frequencies are limited to the twelve &#8220;well tempered&#8221; notes.  As the potentiometer is turned the note played changes.  There&#8217;s a little bit of smoothing (legato) in between note transitions too (so it sounds a bit more theremin-like).</p>
<p>All code for this <a href="http://github.com/lilspikey/arduino_sketches/blob/master/theremin/theremin.pde">Arduino &#8220;theremin&#8221;</a> is available on github, as part of my <a href="http://github.com/lilspikey/arduino_sketches">Arduino Sketches</a> project.</p>
<p>Here&#8217;s a demo of the tone generation in action:</p>
<p><center><br />
<object type="application/x-shockwave-flash" width="400" height="300" data="http://www.flickr.com/apps/video/stewart.swf?v=71377" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="intl_lang=en-us&#038;photo_secret=bc9bd6b0dc&#038;photo_id=4695837166&#038;flickr_show_info_box=true"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=71377"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=71377" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&#038;photo_secret=bc9bd6b0dc&#038;photo_id=4695837166&#038;flickr_show_info_box=true" height="300" width="400"></embed></object><br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.psychicorigami.com/2010/06/13/arduino-tone-generatortheremin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My First Arduino Project (Morse Code)</title>
		<link>http://www.psychicorigami.com/2010/05/26/my-first-arduino-project-morse-code/</link>
		<comments>http://www.psychicorigami.com/2010/05/26/my-first-arduino-project-morse-code/#comments</comments>
		<pubDate>Wed, 26 May 2010 19:26:03 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.psychicorigami.com/?p=260</guid>
		<description><![CDATA[So I finally have an Arduino. I&#8217;ve been hankering after one for a while now, after seeing what Build Brighton and others have been able to do with them. So I was very happy when my better half paid attention to the hints I&#8217;d been dropping and got me an Arduino starter kit for my [...]]]></description>
			<content:encoded><![CDATA[<p>So I finally have an <a href="http://www.arduino.cc/">Arduino</a>.  I&#8217;ve been hankering after one for a while now, after seeing what <a href="http://www.buildbrighton.com/wiki/Main_Page">Build Brighton</a> and others have been able to do with them.  So I was very happy when my better half paid attention to the hints I&#8217;d been dropping and got me an <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9284">Arduino starter kit</a> for my birthday.  That was only a few days ago and thanks to how wonderfully easy the <a href="http://arduino.cc/en/Main/Software">Arduino IDE</a> is, it hasn&#8217;t taken long for me to get things working.  The simplicity of writing the code, hitting upload and seeing the effect on the Arduino within seconds makes it really quick to try out different ideas.  The only bit that&#8217;s tricky (for me at least) is the electronics side of things.  Due to a slight fear of accidentally burning out the <a href="http://www.atmel.com/products/avr/">8bit AVR chip</a> at the core of the Arduino I&#8217;m being super cautious.  Though this is due to my at best high school knowledge of electronics.  That and the fact that I&#8217;m pretty much a software boy.</p>
<p>So what to make first?  Well morse code seemed like a good starting point.  I&#8217;d written an app to <a href="http://www.psychicorigami.com/2009/03/01/5k-morse-code-app-using-capslock-led/">output morse on the capslock LED</a> before and the starter kit had LEDs, so it seeded like a good starting point.  On closer inspection there was also a piezoelectric buzzer &#8211; so even better it was possible to generate a tone too!</p>
<p>Getting the <a href="http://arduino.cc/en/Tutorial/Blink">LED to turn on and off</a> was pretty easy and it forms the standard &#8220;hello world&#8221; program for the Arduino.  Getting the buzzer to generate a tone was marginally trickier, but <a href="http://www.faludi.com/2007/04/23/buzzer-arduino-example-code/">not that hard</a> and basically just consisted of turning it on and off quick enough to cause a vibration and therefore make a sound.  With the help of this <a href="http://www.instructables.com/id/Play-the-French-Can-Can-Using-an-Arduino-and-Buzze/">guide to making the Arduino play the Can-Can</a> I also had details of how to wire the circuit correctly (in particular adding in a suitable resistor to avoid overloading the AVR chip).</p>
<p>Using the starter kits breadboard, jumper wires, a 330 Ohm resistor, an LED and the piezoelectric buzzer I put together this:</p>
<p><center><br />
<a href="http://www.flickr.com/photos/lilspikey/4641973105/" title="Arduino Morse Code Circuit by lilspikey, on Flickr"><img src="http://farm5.static.flickr.com/4049/4641973105_b90d4983ab.jpg" width="500" height="375" alt="Arduino Morse Code Circuit" /></a><br />
</center></p>
<p>The buzzer had it&#8217;s positive pin wired in to pin 4 on the Arduino and the LED was in turn wired in to pin 13.  In the picture above, I arbitrarily used yellow jumper leads for &#8220;ground&#8221; and green for positive.  So one green lead goes to each pin (4 and 13) and only one yellow lead goes to the &#8220;ground&#8221; on the Arduino.</p>
<p>Initially I hard-coded the message the Arduino was going to output, but having to re-compile each time to change the message seemed a little tedious.  So I decided to get the Arduino to read from the serial port, store the characters it read in, then output the relevant morse.  To achieve this the program has a 512 byte buffer that it fills up with data read from the serial port.  If the buffer is full it signals this by writing back a -1 down the serial port &#8211; otherwise it echos back what it has read in.  As it plays the morse it moves along the buffer looking for the next character.  Once all characters are output it resets the buffer.  The program is actually able to read from the serial port whilst it is turning the LED on/off and generating tones.  It&#8217;s only limited by the size of the buffer it is using and the fact that it can read faster from the serial port than it can output morse code.</p>
<p>Most of the work in the code revolved around trying to both read from the serial port and generate tones.  If the morse was known ahead of time, it would be pretty easy to right several for-loops to run through each character generating tones until we were finished.  However the program would not start reading from the serial port until it had finished outputting the morse.  So apart from using some basic state-machine style antics to keep track of which character we were on and whether we were currently during a dot, dash or silent period the major a-ha moment for me was realizing how to easily generate a consistent tones without using delays in the code.  In <a href="http://www.faludi.com/itp/arduino/buzzer_example.pde">previous code I&#8217;d seen for generating tones</a>, the code looked like:</p>
<pre>
<code>
for (long i=0; i < numCycles; i++){
    digitalWrite(targetPin,HIGH); // write the buzzer pin high to push out the diaphram
    delayMicroseconds(delayValue); // wait for the calculated delay value
    digitalWrite(targetPin,LOW); // write the buzzer pin low to pull back the diaphram
    delayMicroseconds(delayValue); // wait againf or the calculated delay value
}
</code>
</pre>
<p>This is nice and easy to follow, but all those calls to <code>delayMicroseconds</code> mean you are hanging around waiting for the air to move to make a sound.</p>
<p>As I wasn't too concerned with the particular fidelity of the sound from the buzzer I opted for the following instead:</p>
<pre>
<code>
void morse_pulse_on() {
  digitalWrite(LED_PIN, HIGH);
  unsigned long period = micros() % buzzer_delay;
  digitalWrite(BUZZER_PIN, period < (buzzer_delay>>1)? HIGH : LOW);
}
</code>
</pre>
<p>This was called every time through the <code>loop()</code> function if a sound needed to be played.  As there is no delay in calling it, one could then immediately perform other tasks, such as checking for new serial data or turning the LED on and off.  It's quite simple real - the modulus operator (<code>%</code>) is used to get the sub-divide the current time in microseconds into a number between <code>0</code> and <code>buzzer_delay</code> (a value pre-calculated to let us generate the right frequency) representing the current "period".  If we are halfway through this period then we set the buzzer to <code>HIGH</code>, otherwise we set it to <code>LOW</code>.  By repeatedly calling <code>morse_pulse_on</code> we end up with (in this case) a glorious 700Hz tone.</p>
<p>All code for this <a href="http://github.com/lilspikey/arduino_sketches/blob/master/morse/morse.pde">Arduino morse code</a> program is available on github, as part of my <a href="http://github.com/lilspikey/arduino_sketches">Arduino Sketches</a> project.  Hopefully I'll add more code to that project as I get a chance to delve deeper into what the Arduino can do.</p>
<p>Here's a demo of the whole thing in action:</p>
<p><center><br />
<object type="application/x-shockwave-flash" width="480" height="480" data="http://www.flickr.com/apps/video/stewart.swf?v=71377" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="intl_lang=en-us&#038;photo_secret=b4783f8477&#038;photo_id=4642700206&#038;flickr_show_info_box=true"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=71377"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=71377" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&#038;photo_secret=b4783f8477&#038;photo_id=4642700206&#038;flickr_show_info_box=true" height="480" width="480"></embed></object><br />
</center></p>
<p>UPDATE: not long after finishing this, I discovered the <a href="http://arduino.cc/en/Reference/Tone">tone</a> and <a href="http://arduino.cc/en/Reference/NoTone">noTone</a> functions.  These produce a better tone than the technique outlined above.  Though they do involve use of one of the interrupts on the arduino, that's normally used for <a href="http://arduino.cc/en/Tutorial/PWM">PWM</a> on pins 3 and 11 - not that it's a problem for this project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.psychicorigami.com/2010/05/26/my-first-arduino-project-morse-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Chumby Podcast Client Source Code</title>
		<link>http://www.psychicorigami.com/2010/01/09/chumby-podcast-client-source-code/</link>
		<comments>http://www.psychicorigami.com/2010/01/09/chumby-podcast-client-source-code/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 18:46:54 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[chumby]]></category>

		<guid isPermaLink="false">http://www.psychicorigami.com/?p=250</guid>
		<description><![CDATA[Ok so I blogged about a podcatcher/podcast client for the Chumby quite a while ago (August 2008 to be precise). At the time I said I&#8217;d tidy things up and release the source code etc. Well that didn&#8217;t quite happen, but I figured I might as well release the source code. So seeing as I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>Ok so I blogged about a <a href="http://www.psychicorigami.com/2008/08/23/chumby-podcatcher/">podcatcher/podcast client for the Chumby</a> quite a while ago (August 2008 to be precise).  At the time I said I&#8217;d tidy things up and release the source code etc.  Well that didn&#8217;t quite happen, but I figured I might as well release the source code.  So seeing as I&#8217;ve been using <a href="http://git-scm.com/">git</a> a lot lately and <a href="https://github.com/">github</a> is easy to use I thought that&#8217;d I&#8217;d best just put online what I had.</p>
<p>So you can now find the hybrid Python, Javascript and Flash <a href="http://www.chumby.com/">Chumby</a> postcast client I dubbed <a href="http://github.com/lilspikey/chumbycast">chumbycast, on github</a>.  I&#8217;m providing the code just for the curious &#8211; I&#8217;ve had at least one request for it, but I&#8217;m not really going to detail too much of how it works. Though some of this is outlined in the original post where I mentioned the project.</p>
<p>I am tempted to revive this project a bit, but probably by trying a different approach.  I mostly gave up on this as I was creating a UI on the Chumby in Flash and my Flash skills aren&#8217;t exactly great, plus I was trying to use <a href="http://www.mtasc.org/">mtasc</a> which hampered things further.  Which is not to belittle mtasc &#8211; it&#8217;s just with limited time and no previous Flash experience I wasn&#8217;t exactly helping myself by not using some nice friendly Flash IDE.</p>
<p>I&#8217;ve since realised that if I ditched the Flash UI I could probably get quite a bit done.  The Python httpserver side of things was pretty easy.  So if I focussed on that I would then have a few of ways of providing a UI by hijacking existing functionality on the Chumby.</p>
<ul>
<li>The Chumby runs a <a href="http://wiki.chumby.com/mediawiki/index.php/Chumby_as_an_iPod_server">httpserver on port 8080 when an ipod is plugged in</a>, which the UI uses to access playlists etc.  I could mimic this approach and effectively make the podcast client look like an iPod as far as the Chumby&#8217;s UI was concerned.  By plugging in a USB stick loaded up with the podcast client everything would behave the same as if you had plugged in an iPod.</li>
<li>It&#8217;s possible to <a href="http://wiki.chumby.com/mediawiki/index.php/Chumby_and_music">create playlist files and edit the &#8220;My Streams&#8221;</a> section programmatically.  Each podcast subscribed to would create a matching pls or m3u file and be added to the &#8220;My Streams&#8221; section.</li>
<li>Create a javascript/web UI for controlling the playback and subscriptions to podcasts and other podcast management tasks (like removing old files, manually downloading older episodes etc) from another computer.  Possibly adding bonjour/zero-conf support so the Chumby can be browsed to easily</li>
</ul>
<p>I would need to see whether those first two could be made to work for my purpose, but it would make sense to just use the existing UI on the Chumby &#8211; rather than creating a new one.  The existing chumbycast code already provides a javascript/web UI for controlling the playback on the Chumby.  This was originally done so I could remote control the chumby, but also so that I could easily create and debug an API for the Flash UI to use.</p>
<p>The other major missing feature is allowing the podcasts to be paused part way through.  The current client does not support this, as the audio files are streamed and not downloaded.  So that would be the first change to make.  Now that I&#8217;ve dug out the code maybe I&#8217;ll be inspired to play around some more.  I&#8217;ve also been listening to a lot more podcasts (thanks to <a href="http://huffduffer.com/">Huffduffer</a>) so it might happen yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.psychicorigami.com/2010/01/09/chumby-podcast-client-source-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to sew a felt horse</title>
		<link>http://www.psychicorigami.com/2010/01/02/how-to-sew-a-felt-horse/</link>
		<comments>http://www.psychicorigami.com/2010/01/02/how-to-sew-a-felt-horse/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 12:03:21 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Craft]]></category>

		<guid isPermaLink="false">http://www.psychicorigami.com/?p=239</guid>
		<description><![CDATA[I&#8217;ve clearly picked up the making felt toys bug. For Christmas this year I ended up making a pair of felt horses for two of my cousin&#8217;s children: I thought I&#8217;d have a go at writing up the instructions for how I did this &#8211; complete with template for making your own: How to sew [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve clearly picked up the <a href="http://www.psychicorigami.com/2009/10/12/two-months-of-felt-creations/">making felt toys bug</a>.  For Christmas this year I ended up making a pair of felt horses for two of my cousin&#8217;s children:</p>
<p><center><a title="A pair of felt horses by lilspikey, on Flickr" href="http://www.flickr.com/photos/lilspikey/4203959561/"><img src="http://farm5.static.flickr.com/4008/4203959561_18e63783b6.jpg" alt="A pair of felt horses" width="500" height="375" /></a></center></p>
<p>I thought I&#8217;d have a go at writing up the instructions for how I did this &#8211; complete with template for making your own:</p>
<p><center><br />
<a href="http://www.psychicorigami.com/craft/horsies/"><img src="http://www.psychicorigami.com/wp-content/uploads/2010/01/how-to-sew-a-felt-horse.png" alt="" title="how-to-sew-a-felt-horse" width="400" height="344" /></p>
<p>How to sew a felt horse</a><br />
</center></p>
<p>It&#8217;s pretty easy really.  As long as you can sew some backstitch you should be able to make this easily.  If not then it might not be the worst first project to try either!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.psychicorigami.com/2010/01/02/how-to-sew-a-felt-horse/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Django Batch Select</title>
		<link>http://www.psychicorigami.com/2009/11/23/django-batch-select/</link>
		<comments>http://www.psychicorigami.com/2009/11/23/django-batch-select/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 10:00:00 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.psychicorigami.com/?p=228</guid>
		<description><![CDATA[So quite a while ago I wrote about avoiding the n+1 query problem with SQLObject. I&#8217;ve since been using Django a lot more. In particular at my day job I&#8217;ve been improving a Django site we&#8217;ve inherited. This particular site suffered from a few too many SQL queries and needed speeding up. Some of the [...]]]></description>
			<content:encoded><![CDATA[<p>So quite a while ago I wrote about <a href="http://www.psychicorigami.com/2007/12/16/using-raw-sql-with-sqlobject-and-keeping-the-object-y-goodness/">avoiding the n+1 query problem with SQLObject</a>.  I&#8217;ve since been using <a href="http://www.djangoproject.com/">Django</a> a lot more.  In particular at <a href="http://www.sensibledevelopment.com/">my day job</a> I&#8217;ve been improving a Django site we&#8217;ve inherited.  This particular site suffered from a few too many SQL queries and needed speeding up.  Some of the issues related to the classic n+1 problem.  i.e. one initial query triggering a further n queries (where n is the number of results in the first query).</p>
<p>A liberal dose of <a href="http://docs.djangoproject.com/en/dev/ref/models/querysets/#id4">select_related</a> helped.  However that was only useful in the cases where a ForeignKey needed to be pre-fetched.</p>
<p>In the case however there was a page that was selecting a set of objects that had tags.  The tags for each object were being displayed along side a link to the main object.  Given that the initial query returned over three hundred objects, this meant the page was performing another three hundred (plus) queries to fetch the individual tags for each object!  Now we could cache the page and that&#8217;s was indeed what was being done.  The trouble however was when the cache expired.  It also made things painful when developing &#8211; as I&#8217;d typically want to disable caching whilst I&#8217;m making changes to pages frequently.</p>
<p>I came up with a specific solution for this project &#8211; to perform the initial query, then a second query to fetch *all* of the other tags in one go.  The results of the second query could then be stitched into the original results, to make them available in a handy manor within the page&#8217;s template.</p>
<p>I took the original idea and made it re-usable and am now releasing that code as <a href="http://github.com/lilspikey/django-batch-select">Django Batch Select</a>.  There are examples of how to use it over at <a href="http://github.com/lilspikey/django-batch-select">github</a>, but it works a bit like this:</p>
<pre><code>
&gt;&gt;&gt; entries = Entry.objects.batch_select('tags').all()
&gt;&gt;&gt; entry = entries[0]
&gt;&gt;&gt; print entry.tags_all
[&lt;Tag: Tag object&gt;]
</code></pre>
<p>It&#8217;s a very early release &#8211; after the result of only a few hours coding, so use with care.  It does have 100% test code coverage at the moment and I&#8217;m reasonable confident about it working.  Please try it out and let me know whether it works for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.psychicorigami.com/2009/11/23/django-batch-select/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Two Months of Felt Creations</title>
		<link>http://www.psychicorigami.com/2009/10/12/two-months-of-felt-creations/</link>
		<comments>http://www.psychicorigami.com/2009/10/12/two-months-of-felt-creations/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 09:00:00 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[Craft]]></category>

		<guid isPermaLink="false">http://www.psychicorigami.com/?p=212</guid>
		<description><![CDATA[It&#8217;s been a busy two months for me. I&#8217;ll soon be getting married and there&#8217;s been quite a lot to do. A while back I finished the invites for the wedding (which involved hand-stamped wrapping paper): From there I moved on to creating a pair of robins to sit on top of the wedding cake: [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a busy two months for me.  I&#8217;ll soon be <a href="http://montgomery-williams.com/">getting married</a> and there&#8217;s been quite a lot to do.  A while back I finished the invites for the wedding (which involved hand-stamped wrapping paper):</p>
<p><center><br />
<a href="http://www.flickr.com/photos/lilspikey/3754837888/" title="Wedding Invites by lilspikey, on Flickr"><img src="http://farm3.static.flickr.com/2577/3754837888_e3245312e2_m.jpg" width="240" height="180" alt="Wedding Invites" /></a><br />
</center></p>
<p>From there I moved on to creating a pair of robins to sit on top of the wedding cake:</p>
<p><center><br />
<a href="http://www.flickr.com/photos/lilspikey/3781536205/" title="Finished Robin Cake Toppers by lilspikey, on Flickr"><img src="http://farm3.static.flickr.com/2429/3781536205_89441e7a0f_m.jpg" width="240" height="180" alt="Finished Robin Cake Toppers" /></a> <a href="http://www.flickr.com/photos/lilspikey/3782330222/" title="Robins by lilspikey, on Flickr"><img src="http://farm3.static.flickr.com/2644/3782330222_697b088f0d_m.jpg" width="240" height="180" alt="Robins" /></a> <a href="http://www.flickr.com/photos/lilspikey/3782342972/" title="One finished, one robin nearly finished by lilspikey, on Flickr"><img src="http://farm3.static.flickr.com/2494/3782342972_eb49106d79_m.jpg" width="240" height="180" alt="One finished, one robin nearly finished" /></a><br />
</center></p>
<p>The robins are made out of felt and stuffed using bits of cut-up cotton sheet (as that was all I had to hand at the time &#8211; hence also the green cotton).  The legs are simply silver wire stitched into place inside, with the red-breast covering up the extra stitches needed.  The eyes are just small black beads (from <a href="http://www.beadsunlimited.co.uk/">Beads Unlimited</a> in Brighton, as was the silver wire).</p>
<p>I felt they turned out really well, so seeing as they didn&#8217;t take too long (a couple of hours each) we decided it&#8217;d be nice to make more felt creatures (following an autumn theme) for table centrepieces.  Initially we planned on one creature per table, then two and so with some extra help from my bride-to-be we ended up with twenty eight felt hedgehogs:</p>
<p><center><br />
<a href="http://www.flickr.com/photos/lilspikey/3950486371/" title="Hedgehogs with conkers by lilspikey, on Flickr"><img src="http://farm3.static.flickr.com/2640/3950486371_f956c2bf9a_m.jpg" width="240" height="180" alt="Hedgehogs with conkers" /></a> <a href="http://www.flickr.com/photos/lilspikey/3950487655/" title="Hedgehogs boxed and waiting by lilspikey, on Flickr"><img src="http://farm3.static.flickr.com/2582/3950487655_b59bb95070_m.jpg" width="240" height="180" alt="Hedgehogs boxed and waiting" /></a> <a href="http://www.flickr.com/photos/lilspikey/3840579140/" title="Hedgehogs in production by lilspikey, on Flickr"><img src="http://farm3.static.flickr.com/2582/3840579140_0b933cc017_m.jpg" width="240" height="180" alt="Hedgehogs in production" /></a> <a href="http://www.flickr.com/photos/lilspikey/3803697896/" title="Felt Hedgehog in progress by lilspikey, on Flickr"><img src="http://farm3.static.flickr.com/2509/3803697896_bf30055971_m.jpg" width="240" height="180" alt="Felt Hedgehog in progress" /></a><br />
</center></p>
<p>Again the hedgehogs were made of felt.  This time they were stuffed with wadding which made things easier.  The spines were glued on as &#8220;fringed&#8221; bits of felt, with a special widows-peak shaped piece for the head.  This time the eyes and nose were just small bits of black felt, glued in place &#8211; so as to be marginally more child-friendly.  Each hedgehog body consists of three pieces of felt &#8211; two sides and a smaller bottom piece.  The bottom piece makes them stand fairly levelly and also gives them a more rounded look.</p>
<p>Somewhere during this time I&#8217;ve also had several friends children&#8217;s first birthdays to contend with.  So seeing as I was in a felt creature production mood I turned my hand to three felt toys:</p>
<p><center><br />
<a href="http://www.flickr.com/photos/lilspikey/3975343592/" title="Finished Felt Max (from Where the wild things are) by lilspikey, on Flickr"><img src="http://farm3.static.flickr.com/2589/3975343592_81df443787_m.jpg" width="240" height="180" alt="Finished Felt Max (from Where the wild things are)" /></a> <a href="http://www.flickr.com/photos/lilspikey/3974465999/" title="Felt Spaceman by lilspikey, on Flickr"><img src="http://farm3.static.flickr.com/2454/3974465999_957cfca2df_m.jpg" width="180" height="240" alt="Felt Spaceman" /></a> <a href="http://www.flickr.com/photos/lilspikey/3853034451/" title="Purple Felt Monster by lilspikey, on Flickr"><img src="http://farm4.static.flickr.com/3509/3853034451_a75193f2a2_m.jpg" width="240" height="180" alt="Purple Felt Monster" /></a><br />
</center></p>
<p>I realised the other day that all thirty three of these were made during a roughly two month period &#8211; meaning one felt creation every two days!  Not a bad rate of productivity I guess.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.psychicorigami.com/2009/10/12/two-months-of-felt-creations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
