<?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>about:benjie &#187; Code</title>
	<atom:link href="http://www.benjiegillam.com/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benjiegillam.com</link>
	<description>Benjie Gillam's blog, and home of MythPyWii - probably the best Wii remote (Wiimote) interface to MythTV - see sidebar.</description>
	<lastBuildDate>Tue, 06 Apr 2010 14:14:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iPhone Music and Sound Effects in Parallel</title>
		<link>http://www.benjiegillam.com/2010/04/iphone-music-and-sound-effects-in-parallel/</link>
		<comments>http://www.benjiegillam.com/2010/04/iphone-music-and-sound-effects-in-parallel/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 13:49:55 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[sound]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=337</guid>
		<description><![CDATA[I was trying to find out how to use [MPMusicPlayerController iPodMusicPlayer] and AVAudioPlayer in parallel. I&#8217;d read before that I&#8217;d need Audio Sessions, but the documentation for that was huge and confusing. Fortunately Andrew pointed me at this post from Mark at Sputnik Games which solved my issue immediately just by copying and pasting 14 [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to find out how to use [MPMusicPlayerController iPodMusicPlayer] and AVAudioPlayer in parallel. I&#8217;d read before that I&#8217;d need Audio Sessions, but the documentation for that was huge and confusing. Fortunately Andrew pointed me at <a title="iPhone games and iPod Music" href="http://www.sputnikgames.com/blog/?p=14" target="_blank">this post</a> from Mark at Sputnik Games which solved my issue immediately just by copying and pasting 14 lines of code into the applicationDidFinishLaunching method of my application delegate (see below). Sputnik Games&#8217; blog doesn&#8217;t seem to support comments, so I thought I&#8217;d buy his latest game, <a href="http://www.sputnikgames.com/aerolite_iphone_game.htm">Aerolite</a>, and write this post to show my appreciation. Thanks Mark!</p>
<blockquote><p><code class="source">

  OSStatus result = AudioSessionInitialize(NULL, NULL, NULL, self);
  <span class="enscript-keyword">if</span> (result) {
     <span class="enscript-comment">// Init error, handle error here
</span>  }<span class="enscript-keyword">else</span> {
    UInt32 category = kAudioSessionCategory_AmbientSound;
    result = AudioSessionSetProperty(kAudioSessionProperty_AudioCategory,
                                     <span class="enscript-keyword">sizeof</span>(category), &amp;category);
    <span class="enscript-keyword">if</span> (result) {
       <span class="enscript-comment">// set audio session error, handle error here
</span>    }<span class="enscript-keyword">else</span> {
      result = AudioSessionSetActive(true);
      <span class="enscript-keyword">if</span> (result) {
         <span class="enscript-comment">// Set audio session active error, handle error here
</span>      }
    }
  }</code>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2010/04/iphone-music-and-sound-effects-in-parallel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MythPyWii &#8211; now on Google Code</title>
		<link>http://www.benjiegillam.com/2010/01/mythpywii-now-on-google-code/</link>
		<comments>http://www.benjiegillam.com/2010/01/mythpywii-now-on-google-code/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 18:58:10 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythPyWii]]></category>
		<category><![CDATA[MythTV]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=335</guid>
		<description><![CDATA[Fancy submitting to MythPyWii? Let me know! It&#8217;s now on Google Code.
Code, documentation, bugs, bugfixes, etc all welcome!
]]></description>
			<content:encoded><![CDATA[<p>Fancy <a href="http://code.google.com/p/mythpywii/">submitting to MythPyWii</a>? Let me know! It&#8217;s now on Google Code.</p>
<p>Code, documentation, bugs, bugfixes, etc all welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2010/01/mythpywii-now-on-google-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MythPyWii Power Update (v17)</title>
		<link>http://www.benjiegillam.com/2009/10/mythpywii-power-update-v17/</link>
		<comments>http://www.benjiegillam.com/2009/10/mythpywii-power-update-v17/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 17:37:58 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythPyWii]]></category>
		<category><![CDATA[MythTV]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Open source]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=242</guid>
		<description><![CDATA[



Image via Wikipedia



Thanks to Matthew Zimmerman for sending me his modified version of MythPyWii, it now has power-saving &#8211; after 35 minutes of inactivity the Wiimote turns off. You can download the latest version, as always, here; or you can get this specific version (v17) here.
I love open source!

]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 282px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Myth_tv_logo.png"><img title="Myth tv logo" src="http://upload.wikimedia.org/wikipedia/commons/6/6a/Myth_tv_logo.png" alt="Myth tv logo" width="272" height="91" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Myth_tv_logo.png">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>Thanks to Matthew Zimmerman for sending me his modified version of MythPyWii, it now has power-saving &#8211; after 35 minutes of inactivity the Wiimote turns off. You can download the latest version, as always, <a title="Latest MythPyWii version" href="http://www.benjiegillam.com/code/myth_py_wii.py" target="_blank">here</a>; or you can get this specific version (v17) <a title="MythPyWii revision 17" href="http://www.benjiegillam.com/code/myth_py_wii.r17.py" target="_blank">here</a>.</p>
<p>I love open source!</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/422a939e-dfa7-48f3-9059-6e69acd0420a/"><img class="zemanta-pixie-img" style="border: medium none ; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=422a939e-dfa7-48f3-9059-6e69acd0420a" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2009/10/mythpywii-power-update-v17/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Arduino Pin Speed (Multiplexing)</title>
		<link>http://www.benjiegillam.com/2009/09/arduino-pin-speed-multiplexing/</link>
		<comments>http://www.benjiegillam.com/2009/09/arduino-pin-speed-multiplexing/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 21:13:57 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Binary numeral system]]></category>
		<category><![CDATA[Clock signal]]></category>
		<category><![CDATA[LED]]></category>
		<category><![CDATA[Source code]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=224</guid>
		<description><![CDATA[I&#8217;m working on a new project, I&#8217;ve got a 8&#215;8 dual colour dot matrix display (£2.50 delivered from Earthshine Design) and I want to power it from the Arduino. One way of making a chip like that (which has 2&#215;8x8 = 128 LEDs) would be to have a common ground and an additional 128 pins [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.earthshinedesign.co.uk/index.php?route=product/product&amp;path=38_43&amp;product_id=82" target="_blank"><img class="alignright" title="8x8 dual colour dot matrix display" src="http://www.earthshinedesign.co.uk/image/cache/1425313_75-250x250.jpg" alt="" width="250" height="250" /></a>I&#8217;m working on a new project, I&#8217;ve got a <a title="8x8 dual colour dot matrix display" href="http://www.earthshinedesign.co.uk/index.php?route=product/product&amp;path=38_43&amp;product_id=82" target="_blank">8&#215;8 dual colour dot matrix display</a> (£2.50 delivered from Earthshine Design) and I want to power it from the <a class="zem_slink" title="Arduino" rel="homepage" href="http://www.arduino.cc" target="_blank">Arduino</a>. One way of making a chip like that (which has 2&#215;8x8 = 128 <a class="zem_slink" title="Light-emitting diode" rel="wikipedia" href="http://en.wikipedia.org/wiki/Light-emitting_diode" target="_blank">LEDs</a>) would be to have a common ground and an additional 128 pins &#8211; one for each LED. This, I think you&#8217;d agree, would be a nightmare, so instead they&#8217;ve basically gone for an 8&#215;16 grid for a total of 24 pins. This raises two main problems:</p>
<ol>
<li>You can&#8217;t turn 2 arbitrary LEDs on at the same time unless they are on the same row/column. (Doing so would actually draw a square of LEDs.)</li>
<li>My Arduino doesn&#8217;t have enough digital input/output pins</li>
</ol>
<p>Point 1 is easily solved &#8211; we simply update just one row at a time, letting <a href="http://en.wikipedia.org/wiki/Persistence_of_vision" target="_blank">Persistance Of Vision</a> (POV) do the hard work for us. Point 2 is the subject of this post &#8211; multiplexing, combining multiple individual signals into just one signal. I will not be using this dot matrix display in this post, instead I will simply be powering normal LEDs. I wanted to find out if the Arduino is fast enough to multiplex the data through just a few pins in order to power this display. The answer (one of my favourite answers!) is: &#8220;Yes, but not without some hacking.&#8221; Read on&#8230;</p>
<p><span id="more-224"></span></p>
<h2>The Hardware</h2>
<p>In order to get a balance between the number of pins we use for this and the speed of the output I&#8217;ve decided to use 3 data pins, each controlling 8 bits, for a total of 24 bits (the same as the number of pins on the LED component &#8211; no coincidence!) The way that I have implemented it, we also need 2 pins for clocks (one fast, one slow) &#8211; read on. The clock pins will be common to all 3 data pins, so for the rest of this post I will only detail one data pin (8 bits).</p>
<p><a href="http://www.benjiegillam.com/wp-content/uploads/2009/09/arduino-project2.JPG"><img src="http://www.benjiegillam.com/wp-content/uploads/2009/09/arduino-project2-300x155.jpg" alt="The Hardware" title="The Hardware" width="300" height="155" class="aligncenter size-medium wp-image-235" /></a></p>
<p>(Sorry about the messiness. Click for a larger picture. There is a Roboduino (Arduino compatible) board on the left, the LEDs and resistors should be fairly obvious from the photo, then there are 3 chips. From left to right they are the Darlington array, the SIPO shift register and the flip flop array (see below for all of these)).</p>
<h3>Fast clock &#8211; Shift Register</h3>
<p>We want to send the data through one pin (data line 1, DL1) to an external Serial-In Parallel-Out (SIPO) chip, also known as a <a class="zem_slink" title="Shift register" rel="wikipedia" href="http://en.wikipedia.org/wiki/Shift_register" target="_blank">shift-register</a> (I&#8217;m using a <a href="http://www.google.co.uk/search?q=M74HC164B1" target="_blank">M74HC164B1</a> octal shift register). This does exactly what it says &#8211; it takes a serial (single) input and converts it to parallel (multiple) outputs. However the chip just receives some high signals and some low signals &#8211; how should it know how many digital 1s there are in a second&#8217;s worth of high signal? This is where the fast clock (FC) comes in. FC just goes from low to high and back again for every bit of data we send through the data lines, and when it changes from low to high the SIPO chip &#8220;reads&#8221; the value of DL1 and outputs it on it&#8217;s first output pin (Pin1). The next time the SIPO chip reads from DL1, it &#8220;shifts&#8221; the value from Pin1 to the second pin (Pin2), and again stores the value of DL1 (on or off) into Pin1. This continues indefinitely, shifting the data along a pin at a time, filling up all 8 of the SIPO chip&#8217;s output pins (and forever overwriting previous data). Here&#8217;s a diagram from the datasheet:</p>
<p><img src="http://www.benjiegillam.com/wp-content/uploads/2009/09/screenshot736.png" alt="Shift Register" title="Shift Register" width="576" height="470" class="aligncenter size-full wp-image-234" /></p>
<p>Time goes from right to left (the left shows an earlier time than the right). The data is the second signal (the third can just remain high always) and the 4th signal is the clock pulse. Signals 5-12 show the state of the output pins at each point in time.</p>
<h3>Slow Clock &#8211; Flip Flop</h3>
<p>We don&#8217;t want to display this shifting data though, so we use a &#8220;<a class="zem_slink" title="Flip-flop (electronics)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Flip-flop_%28electronics%29" target="_blank">flip-flop</a>&#8221; (FF) to store the values. A flip flop can be thought of as a Serial-In Serial-Out (SISO) chip in that it takes it&#8217;s input and uses that as the output. What&#8217;s so special about it then, I hear you ask, isn&#8217;t it just a bit of wire? The &#8220;special&#8221; thing about flip flops is that they &#8220;store&#8221; this value &#8211; recording it when it receives a clock pulse, like the SIPO chip above. We&#8217;re going to use the slow clock (SC) for this purpose, because we only want to store the values once all 8 bits have been output from the SIPO chip. (The SC is triggered once every 8 FC pulses.) Doing so we wait for the SIPO chip to correctly represent the 8 bits it has been sent, and then we store these values whilst the next 8 bits are loaded. I&#8217;m using a <a href="http://www.google.co.uk/search?q=SN74HC273N" target="_blank">SN74HC273N</a> octal flip flop chip which has 8 individual flip flops in it.</p>
<h3>Boosting &#8211; Darlington array</h3>
<p>Unfortunately the flip flop chip does not supply much current &#8211; not enough to power an LED &#8211; so we need to use transistors to boost the current. I&#8217;ve used a Darlington array to boost the current in my circuit as I had one left over from a previous project (it is a <a href="http://www.google.co.uk/search?q=ULN2803A" target="_blank">ULN2803A</a>).</p>
<h3>Display</h3>
<p>I&#8217;ve displayed the output of just one of the data pins using 8 standard LEDs, each with a resistor that&#8217;s too big (didn&#8217;t have one the correct rating).</p>
<h2>The Software</h2>
<p>To test this, I decided to do some binary counting.</p>
<h3>Initial Software</h3>
<p>First I implemented my own solution, and when I turned of the debugging delays and optimized as much as I could it resulted in 2 of the LEDs (the ones signifying the most significant bits) visibly flashing, a sad result meaning that there would be visible flickering on the final display if I used this method, especially as I was outputting only 8 bits and not 24 (doing 24 would make it roughly half as fast due to the extra digitalWrite operations).</p>
<p><code class="source">
<span class="enscript-comment">// The pins I will be using:
</span><span class="enscript-type">int</span> dataPin = 10;
<span class="enscript-type">int</span> fastClockPin = 11;
<span class="enscript-type">int</span> slowClickPin = 12;
<span class="enscript-comment">// The data to display:
</span>byte count=0; 

<span class="enscript-type">void</span> <span class="enscript-function-name">setup</span>() {
  <span class="enscript-comment">// All the pins are output pins
</span>  pinMode(dataPin,OUTPUT);
  pinMode(fastClockPin, OUTPUT);
  pinMode(slowClockPin, OUTPUT);
  <span class="enscript-comment">// Reset all pins low
</span>  digitalWrite(dataPin, LOW);
  digitalWrite(fastClockPin, LOW);
  digitalWrite(slowClockPin, LOW);
}
<span class="enscript-comment">// This will pulse the fast clock pin
</span><span class="enscript-type">void</span> <span class="enscript-function-name">fastClock</span>() {
  digitalWrite(fastClockPin, HIGH);
  digitalWrite(fastClockPin, LOW);
}
<span class="enscript-comment">// This will pulse the slow clock pin
</span><span class="enscript-type">void</span> <span class="enscript-function-name">slowClock</span>() {
  digitalWrite(slowClockPin, HIGH);
  digitalWrite(slowClockPin, LOW);
}
<span class="enscript-type">void</span> <span class="enscript-function-name">loop</span>() {
  <span class="enscript-comment">// We don't want to edit count, so copy it.
</span>  byte v = count;
  <span class="enscript-type">int</span> i;
  <span class="enscript-comment">// There are 8 bits in a byte, do the following for each bit.
</span>  <span class="enscript-keyword">for</span> (i=0; i&lt;8; i++) {
    <span class="enscript-comment">// Set the data: if v modulo 2 is 1, send high, otherwise low. (v modulo 2 is the remainder when you divide v by 2)
</span>    digitalWrite(dataPin, v%2 == 1 ? HIGH : LOW);
    <span class="enscript-comment">// I've written the data, let the SIPO chip know
</span>    fastClock();
    <span class="enscript-comment">// Shift v 1 bit along, dropping the bit we just checked.
</span>    v = v &gt;&gt; 1;
  }
  <span class="enscript-comment">// All 8 bits have been output, tell the flip flops to store their current values:
</span>  slowClock();
  <span class="enscript-comment">// Increase the value of count by one
</span>  ++count;
}
</code>
</p>
<h3>Abstraction Principle</h3>
<p>Looking around at how to optimize this, I soon found that I could use a built in function shiftOut instead of my own method calling digitalWrite for every bit. I updated my code, changing 11 lines of code to just 1. This did speed it up (their <a class="zem_slink" title="Binary numeral system" rel="wikipedia" href="http://en.wikipedia.org/wiki/Binary_numeral_system" target="_blank">binary arithmetic</a> was faster than my method of the time) but not by enough &#8211; 1 LED still flashed &#8211; there would still be visible flicker. How annoying.</p>
<p><code class="source">
<span class="enscript-comment">// The pins I will be using:
</span><span class="enscript-type">int</span> dataPin = 10;
<span class="enscript-type">int</span> fastClockPin = 11;
<span class="enscript-type">int</span> slowClickPin = 12;
<span class="enscript-comment">// The data to display:
</span>byte count=0; 

<span class="enscript-type">void</span> <span class="enscript-function-name">setup</span>() {
  <span class="enscript-comment">// All the pins are output pins
</span>  pinMode(dataPin,OUTPUT);
  pinMode(fastClockPin, OUTPUT);
  pinMode(slowClockPin, OUTPUT);
  <span class="enscript-comment">// Reset all pins low
</span>  digitalWrite(dataPin, LOW);
  digitalWrite(fastClockPin, LOW);
  digitalWrite(slowClockPin, LOW);
}
<span class="enscript-comment">// REMOVED: fastClock(), because shiftOut() handles this for us.
</span>
<span class="enscript-comment">// This will pulse the slow clock pin
</span><span class="enscript-type">void</span> <span class="enscript-function-name">slowClock</span>() {
  digitalWrite(slowClockPin, HIGH);
  digitalWrite(slowClockPin, LOW);
}
<span class="enscript-type">void</span> <span class="enscript-function-name">loop</span>() {
  <span class="enscript-comment">// REMOVED: Most of the code here, shiftOut() does it all for us:
</span>  shiftOut(dataPin, fastClockPin, LSBFIRST, count);
  <span class="enscript-comment">// All 8 bits have been output, tell the flip flops to store their current values:
</span>  slowClock();
  <span class="enscript-comment">// Increase the value of count by one
</span>  ++count;
}
</code>
</p>
<h3>Digging Deeper</h3>
<p>I was a bit disappointed by this, as I knew from the last SoutHACKton meetup that on <a class="zem_slink" title="PICAXE" rel="wikipedia" href="http://en.wikipedia.org/wiki/PICAXE" target="_blank">PICAXE</a> boards you could set multiple pins at the same time. Setting just one pin at a time in Arduino seemed unnecessarily slow. I dug a bit deeper in the <a title="Arduino Extended Reference" href="http://arduino.cc/en/Reference/Extended" target="_blank">extended documentation</a>, and came across <a title="Arduino Port Manipulation" href="http://arduino.cc/en/Reference/PortManipulation" target="_blank">the Port Manipulation page</a>:</p>
<blockquote><p>You may need to be able to turn pins on and off very quickly, meaning within fractions of a microsecond. If you look at the source code in lib/targets/arduino/wiring.c, you will see that digitalRead() and digitalWrite() are each about a dozen or so lines of code, which get compiled into quite a few machine instructions. Each machine instruction requires one clock cycle at 16MHz, which can add up in time-sensitive applications. Direct port access can do the same job in a lot fewer <a class="zem_slink" title="Clock signal" rel="wikipedia" href="http://en.wikipedia.org/wiki/Clock_signal" target="_blank">clock cycles</a>.</p></blockquote>
<p>Huzzah! I can write multiple pins at once, and not only that, I can skip a lot of the clever code that the Arduino libraries come with as I&#8217;m happy making assumptions about my program&#8217;s operation. Excellent!</p>
<p>I had a look at the built in functions, and revised my binary arithmetic so that I could be as optimized as possible, and ran the code&#8230;</p>
<p><code class="source">
<span class="enscript-comment">// REMOVED: the pins (these are now implicit in the binary masks below rather than explicit as before)
</span><span class="enscript-comment">// The data to display:
</span>byte count=0;
<span class="enscript-comment">// Alternatively: unsigned int count = 0;
</span>
<span class="enscript-type">void</span> <span class="enscript-function-name">setup</span>() {
  <span class="enscript-comment">// The pins I am using are output pins: (12,11,10)
</span>  DDRB = B00011100;
  <span class="enscript-comment">// Reset all pins low:
</span>  PORTB = B00000000;
}
<span class="enscript-type">int</span> i;
<span class="enscript-type">void</span> <span class="enscript-function-name">loop</span>() {
  <span class="enscript-comment">// REMOVED: most previous code
</span>  <span class="enscript-comment">// Loop through the bits of count. (if count is an unsigned int, then use this instead:) for (i=0; i &lt; 16; i++) {
</span>  <span class="enscript-keyword">for</span> (i=0; i &lt; 8; i++) {
    <span class="enscript-comment">// Turn all clocks off, and set the data pin
</span>    PORTB = B00000000 | (!!(count &amp; (1 &lt;&lt; i)) &lt;&lt; 2);
    <span class="enscript-comment">// Leave the data pin as it is, turn on the fast clock pin, and if we're on the last bit also turn on the slow clock pin
</span>    PORTB |= B00001000 | (!!(i == 7) &lt;&lt; 4);
    <span class="enscript-comment">// If we're working with an unsigned int, then change the 7 above to a 15.
</span>  }
  <span class="enscript-comment">// Increase the value of count by one
</span>  ++count;
}
</code>
</p>
<p>... All the LEDs appeared on all the time... Either it's working perfectly or something's very wrong. Fortunately by adding a delay into the loop, I could see it was the former, and I celebrated! But just how much faster is it? I couldn't use the Arduinos internal timing, as timing it would cause it to use more processing power and thus slow down... Instead I decided to display the 8 most significant bits of a 16bit number, and see how many of those flickered. All except one flickered (not unexpected) but this meant it was significantly faster than before.</p>
<p>I timed the slowest flashing LED - one full cycle (on to off and back on again) of this 1st bit took an average of 2.2 seconds. This meant that one full cycle of the 9th bit (the one we're bothered about - the slowest of the initial 8 bits) was taking 2.2/256 = 0.0086s, or, in other words, it was running at 116Hz - good enough to not be noticeable by human perception (standard TV is 25-30 Hz). (This also means that the fastest bit is being pulsed at around 15,000Hz.) This is just 8bits, mind, not 24. Adding in the extra bits would not be too taxing on the system though - purely mathematics - as we can set all the pins in the same step. I would expect it to run all 24 bits at around 40-60Hz. </p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/20a08457-e3af-41d3-a25c-0a4b3401d280/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=20a08457-e3af-41d3-a25c-0a4b3401d280" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2009/09/arduino-pin-speed-multiplexing/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>iPhone SDK Upload Issues? Blame Apple&#8217;s &#8220;Compress This&#8221; Feature.</title>
		<link>http://www.benjiegillam.com/2009/06/iphone-sdk-upload-issues-blame-apples-compress-this-feature/</link>
		<comments>http://www.benjiegillam.com/2009/06/iphone-sdk-upload-issues-blame-apples-compress-this-feature/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 16:26:50 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=214</guid>
		<description><![CDATA[If your app won&#8217;t upload but you&#8217;re sure you&#8217;ve compiled it and signed it right, the fault might not be yours. For me, it was the built in &#8220;Compress [Folder]&#8230;&#8221; option &#8211; the archive produced from this might be missing files. You&#8217;re likely to see such errors as:
&#8220;The binary you uploaded was invalid. The signature [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 170px"><a href="http://jasonjeffrey.files.wordpress.com/2007/09/apple-sucks.png"><img title="Apple Sucks" src="http://jasonjeffrey.files.wordpress.com/2007/09/apple-sucks.png" alt="Apple Sucks" width="160" height="154" /></a><p class="wp-caption-text">Apple Sucks</p></div>
<p>If your app won&#8217;t upload but you&#8217;re sure you&#8217;ve compiled it and signed it right, the fault might not be yours. For me, it was the built in &#8220;Compress [Folder]&#8230;&#8221; option &#8211; the archive produced from this might be missing files. You&#8217;re likely to see such errors as:</p>
<p>&#8220;The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate.&#8221;</p>
<p>&#8220;Icon specified in the info.plist not found under the top level app wrapper&#8221;</p>
<p>Seriously, Apple, what the f*ck? Thats 2 hours of my life lost because Apple couldn&#8217;t nail the basics: an archive utility. I&#8217;m so angry right now.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/374b9e2b-0b73-4742-a18f-37c05e7c688b/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=374b9e2b-0b73-4742-a18f-37c05e7c688b" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2009/06/iphone-sdk-upload-issues-blame-apples-compress-this-feature/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Calling All Southampton Hackers!</title>
		<link>http://www.benjiegillam.com/2009/05/calling-all-southampton-hackers/</link>
		<comments>http://www.benjiegillam.com/2009/05/calling-all-southampton-hackers/#comments</comments>
		<pubDate>Wed, 20 May 2009 09:36:48 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythPyWii]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[Personal computer]]></category>
		<category><![CDATA[Southackton]]></category>
		<category><![CDATA[Southampton]]></category>
		<category><![CDATA[Wii]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=199</guid>
		<description><![CDATA[



Image via Wikipedia




Before we start, just to be clear &#8211; this is not for crackers (people who illegally break in to computer systems) but for hackers (people who modify the software or hardware of their computer system including building, rebuilding, modifying and creating software and electronic hardware either to make it better, faster, give added [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Southampton_-_Bargate.JPG"><img title="City of Southampton" src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Southampton_-_Bargate.JPG/300px-Southampton_-_Bargate.JPG" alt="City of Southampton" width="300" height="216" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Southampton_-_Bargate.JPG">Wikipedia</a></dd>
</dl>
</div>
</div>
<blockquote>
<p style="text-align: right;">Before we start, just to be clear &#8211; this is not for <a title="Crackers are Black Hat Hackers" href="http://en.wikipedia.org/wiki/Hacker_(computer_security)#Black_hat" target="_blank">crackers</a> (people who illegally break in to computer systems) but for <a title="Wikipedia Hacker (hobbyist) article" href="http://en.wikipedia.org/wiki/Hacker_(hobbyist)" target="_blank">hackers</a> (people who modify the software or hardware of their computer system including building, rebuilding, modifying and creating software and electronic hardware either to make it better, faster, give added features or to make it do something it was never intended to do).</p>
</blockquote>
<p><strong>UPDATE</strong>: we have a google group: <a title="Southackton Google Group" href="http://groups.google.com/group/southackton" target="_blank">http://groups.google.com/group/southackton</a></p>
<p>I&#8217;m intending on setting up a &#8220;<a title="Hackerspace Wikipedia Article" href="http://en.wikipedia.org/wiki/Hackerspace" target="_blank">Hackerspace</a>&#8221; in <a class="zem_slink" title="Southampton" rel="wikipedia" href="http://en.wikipedia.org/wiki/Southampton">Southampton</a> targeted around software programming (for fun) and <a class="zem_slink" title="Hacker (hobbyist)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Hacker_%28hobbyist%29">hardware hacking</a> (e.g. robotics). I anticipate that people would attend the hackerspace either with their own personal projects (such as <a title="MythPyWii" href="http://www.benjiegillam.com/mythpywii-installation/" target="_blank">controlling their television using a Wii remote</a>), or looking to join in on a cool project. The idea is that we can all share knowledge and help each other out in a fun and innovative environment.</p>
<p>I am provisionally calling this project Sout<span style="color: #ff0000;">hack</span>ton, though I expect (hope!) a better name will surface once more people are interested! If you or anyone you know is interested, please contact me via email (my name at benjiegillam.com) or by leaving a comment on this post.</p>
<p>The ultimate goal would be having an &#8220;office&#8221; somewhere in Southampton where members can drop in any time (within reason) and get to work on their project/just hang out with fellow hackers. If you work from home you could even work form the Hackerspace directly &#8211; it wouldn&#8217;t be so lonely! I am, however, expecting that we would run it as a &#8220;club&#8221; until we have enough interested members to make it feasible. Whether this club be weekly, fortnightly, monthly, or bi-monthly is a matter for interested persons to discuss &#8211; get in contact and let me know what you think!</p>
<p>As you may know if you read this blog (doubtful!), I am a great fan of <a class="zem_slink" title="Open source" rel="wikipedia" href="http://en.wikipedia.org/wiki/Open_source">open source</a>, and have been a dedicated <a class="zem_slink" title="Linux" rel="wikipedia" href="http://en.wikipedia.org/wiki/Linux">GNU/Linux</a> user for almost 10 years now, so Linux users would be cool to have as they tend to be interested in tweaking hardware/software, however everyone would be welcome independent of their choice of <a class="zem_slink" title="Operating system" rel="wikipedia" href="http://en.wikipedia.org/wiki/Operating_system">operating system</a>. Yes, that&#8217;s right &#8211; even Windows users!</p>
<p>Further, there is no required skill level. I&#8217;m happy to have people attend who want to acheive something (e.g. making a webcam recognise who is sat at the PC and change the computers background to a related picture/have their favourite teddy walk towards them) but have no idea how to go about it, so long as they are patient and willing to learn!</p>
<p>I hope you&#8217;re interested &#8211; let me know!</p>
<p><strong>UPDATE</strong>: if you&#8217;re interested, sign up to our google group: <a title="Southackton Google Group" href="http://groups.google.com/group/southackton" target="_blank">http://groups.google.com/group/southackton</a>.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/3a5211f8-7322-41da-89fa-0b90fecabf9a/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=3a5211f8-7322-41da-89fa-0b90fecabf9a" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2009/05/calling-all-southampton-hackers/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Useful Bash Scripts</title>
		<link>http://www.benjiegillam.com/2009/04/useful-bash-scripts/</link>
		<comments>http://www.benjiegillam.com/2009/04/useful-bash-scripts/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 18:44:41 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Command-line interface]]></category>
		<category><![CDATA[Diff]]></category>
		<category><![CDATA[Grep]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=190</guid>
		<description><![CDATA[



Image via Wikipedia



Here&#8217;s a couple of bash scripts I&#8217;ve written recently that might be of use to someone.They work well under Ubuntu, and should work under any GNU/Linux or Unix system with the suitable software installed.
Improved &#8220;svn diff&#8221; command (ignores whitespace, colour highlights output, requires colordiff) &#8211; I put it in /usr/local/bin/svndiff:

#!/bin/bash
svn diff -x -w [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 212px;">
<dt class="wp-caption-dt"><a href="http://en.wikipedia.org/wiki/Image:Bash-org.png"><img title="Bash" src="http://upload.wikimedia.org/wikipedia/en/thumb/4/41/Bash-org.png/202px-Bash-org.png" alt="Bash" height="85" width="202"></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://en.wikipedia.org/wiki/Image:Bash-org.png">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>Here&#8217;s a couple of <a class="zem_slink" title="Bash" rel="wikipedia" href="http://en.wikipedia.org/wiki/Bash">bash</a> scripts I&#8217;ve written recently that might be of use to someone.They work well under <a class="zem_slink" title="Ubuntu" rel="homepage" href="http://www.ubuntu.com/">Ubuntu</a>, and should work under any <a class="zem_slink" title="Linux" rel="wikipedia" href="http://en.wikipedia.org/wiki/Linux">GNU/Linux</a> or Unix system with the suitable software installed.</p>
<p>Improved &#8220;svn diff&#8221; command (ignores <a class="zem_slink" title="Whitespace (computer science)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Whitespace_%28computer_science%29">whitespace</a>, colour highlights output, requires colordiff) &#8211; I put it in /usr/local/bin/svndiff:</p>
<p><code class="source">
#!/bin/bash
svn diff -x -w $@ | colordiff
</code>
</p>
<p>Improved recursive <a class="zem_slink" title="Grep" rel="wikipedia" href="http://en.wikipedia.org/wiki/Grep">grep</a> command (greps recursively, ignores files in the .svn folders, ignores temporary files, highlights output in colour) &#8211; I put it in /usr/local/bin/grepr:</p>
<p><code class="source">
#!/bin/sh
SEARCHTERM=$1;
shift;
find . -type f -a -not -iname &quot;*~&quot; -a -not -iwholename &quot;*/.svn/*&quot; -exec grep -H --color=auto $@ &quot;$SEARCHTERM&quot; &quot;{}&quot; \;</code>
</p>
<p>You might also be interested in my previous &#8220;whoops I deleted files without telling svn&#8221; post <a title="Telling SVN you deleted those files..." href="http://www.benjiegillam.com/2009/02/svn-hint-automatically-removing-manually-deleted-files-from-svn/">here</a>.</p>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/2d71108e-406c-49e4-a42b-24959e42cab0/" title="Zemified by Zemanta"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_c.png?x-id=2d71108e-406c-49e4-a42b-24959e42cab0" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2009/04/useful-bash-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SVN Hint: Automatically removing manually deleted files from SVN</title>
		<link>http://www.benjiegillam.com/2009/02/svn-hint-automatically-removing-manually-deleted-files-from-svn/</link>
		<comments>http://www.benjiegillam.com/2009/02/svn-hint-automatically-removing-manually-deleted-files-from-svn/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 11:04:30 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Command-line interface]]></category>
		<category><![CDATA[Grep]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=178</guid>
		<description><![CDATA[



Image via Wikipedia



When deleting files in a working copy of an SVN repository you should do it on the command line: svn rm [filename]. If, however, you don&#8217;t do this (e.g. delete through a gui, or just do &#8220;rm&#8221; without the &#8220;svn&#8220;) then SVN gets confused, and puts a &#8220;!&#8221; in it&#8217;s status before all [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 212px;">
<dt class="wp-caption-dt"><a href="http://en.wikipedia.org/wiki/Image:Bash-org.png"><img title="Bash" src="http://upload.wikimedia.org/wikipedia/en/thumb/4/41/Bash-org.png/202px-Bash-org.png" alt="Bash" width="202" height="85" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://en.wikipedia.org/wiki/Image:Bash-org.png">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>When deleting files in a working copy of an <a class="zem_slink" title="Social Venture Network" rel="wikipedia" href="http://en.wikipedia.org/wiki/Social_Venture_Network">SVN</a> repository you should do it on the command line: <tt>svn rm [filename]</tt>. If, however, you don&#8217;t do this (e.g. delete through a gui, or just do &#8220;<tt>rm</tt>&#8221; without the &#8220;<tt>svn</tt>&#8220;) then SVN gets confused, and puts a &#8220;<tt>!</tt>&#8221; in it&#8217;s status before all the deleted files. If you <tt>svn update</tt>, all the files will be recovered, rendering all your time spent deleting them wasted. Really you should use <tt>svn rm</tt>, but if it&#8217;s already too late for that, you can use this bash fragment to delete the files from SVN:</p>
<blockquote><p><tt>svn status | grep "^\!" | sed 's/^\! *//g' | xargs svn rm</tt></p></blockquote>
<p>This command does a status command, finds all lines starting with &#8220;<tt>!</tt>&#8220;, and then extracts the filename and runs it through &#8220;<tt>svn rm</tt>&#8221; &#8211; really deleting the file.</p>
<p>Caveats:</p>
<ol>
<li>Manually deleted files are not the only things that makes svn use &#8220;<tt>!</tt>&#8221; &#8211; so beware of this! Ensure you do really want to delete all those files!</li>
<li>This works for filenames which are all_one-word/without/any.spaces but I am not sure if it will work or not for filenames with spaces in.</li>
<li>Use at your own risk. The code is simple enough so you should be able to grok what it does.</li>
</ol>
<p>Enjoy!</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.ghacks.net/2009/01/06/save-your-skin-by-customizing-your-bash-prompt/">Save Your Skin by Customizing Your Bash Prompt</a> (ghacks.net)</li>
<li class="zemanta-article-ul-li"><a href="http://www.modhul.com/2008/11/14/moving-directories-in-a-svn-repository-using-tortoise-svn/">Moving Directories in a SVN Repository using Tortoise SVN</a> (modhul.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/fb66b461-1ba1-4d58-a645-8eded5ab2ab4/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=fb66b461-1ba1-4d58-a645-8eded5ab2ab4" alt="Reblog this post [with Zemanta]" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2009/02/svn-hint-automatically-removing-manually-deleted-files-from-svn/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New Year: Get Fit With GymFu!</title>
		<link>http://www.benjiegillam.com/2009/01/new-year-get-fit-with-gymfu/</link>
		<comments>http://www.benjiegillam.com/2009/01/new-year-get-fit-with-gymfu/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 14:29:18 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[AppStore]]></category>
		<category><![CDATA[GymFu]]></category>
		<category><![CDATA[Health]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[PushupFu]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=172</guid>
		<description><![CDATA[I had intended to get fit (and thin) before my wedding last August, however that never happened. And before I knew it it was Christmas, with all that loverly food. I&#8217;m not stupid enough to try and diet over the Christmas period! Instead, I thought, what else is the New Year for if not improving [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 210px"><a href="http://www.GymFu.com/"><img title="PushupFu" src="http://www.gymfu.com/img/helpStart.png" alt="PushupFu Demo" width="200" height="300" /></a><p class="wp-caption-text">PushupFu Demo</p></div>
<p>I had intended to get fit (and thin) before my wedding last August, however that never happened. And before I knew it it was Christmas, with all that loverly food. I&#8217;m not stupid enough to try and diet over the Christmas period! Instead, I thought, what else is the New Year for if not improving ones health?</p>
<p>My business partner <a class="zem_slink" title="Jof Arnold" rel="blog" href="http://www.brainbakery.com">Jof</a> and myself had been working on a fitness app for the iPhone, <a title="PushupFu at GymFu.com" href="http://www.GymFu.com/" target="_blank">PushupFu</a>, for a couple of months and we finally uploaded it to Apple on 23rd December. In a very generous gesture from Apple, the app was released on 1st January (or 31st December, depending where you live!) &#8211; a full week earlier than we were expecting. I find that the app definitely motivates me to do pushups when users challenge me, plus I also intend to complete the training course (should be done by May) &#8211; when I can do 100 pushups I will really feel fit! (Currently I&#8217;m still only able to do single figures, but I have only just started!)</p>
<p>So, if you feel you need to get a bit more toned this year, why not give it a go by visiting <a title="PushupFu at GymFu.com" href="http://www.GymFu.com/" target="_blank">http://www.GymFu.com/</a> ? At time of writing we have 5 reviews in the App Store, all are 5 stars, so give it a go! Check out our other reviews below:</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://uk.techcrunch.com/2009/01/02/pushupfu-turns-iphone-into-fitness-gaming-network/">PushupFu turns iPhone into fitness gaming network</a></li>
<li class="zemanta-article-ul-li"><a href="http://www.indenialhealth.com/?p=514">PushupFu &#8211; Portable Pushup Trainer</a></li>
<li class="zemanta-article-ul-li"><a href="http://kotaku.com/5122566/iphone-game-lets-your-pecs-battle-with-push-ups">iPhone Game Lets Your Pecs Battle With Push Ups [IPhone]</a></li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/0cf2b8c8-f36f-4744-a788-958eee3ea64e/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=0cf2b8c8-f36f-4744-a788-958eee3ea64e" alt="Reblog this post [with Zemanta]" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2009/01/new-year-get-fit-with-gymfu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MythPyWii Bugfixes and Enhancements</title>
		<link>http://www.benjiegillam.com/2008/09/mythpywii-bugfixes-and-enhancements/</link>
		<comments>http://www.benjiegillam.com/2008/09/mythpywii-bugfixes-and-enhancements/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 19:17:52 +0000</pubDate>
		<dc:creator>Benjie</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MythPyWii]]></category>
		<category><![CDATA[MythTV]]></category>
		<category><![CDATA[bugfixes]]></category>
		<category><![CDATA[timestretch]]></category>

		<guid isPermaLink="false">http://www.benjiegillam.com/?p=157</guid>
		<description><![CDATA[

I&#8217;ve just updated MythPyWii to handle the connection to Mythfrontend more smoothly, and to give feedback via the wiimote on error/disconnect. (i.e. if myth closes, the wiimote shakes, and the LED pattern changes to [ . # # . ] instead of [ # . . # ] just before the wiimote turns itself off). [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img zemanta-action-click">
<div class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/16419724@N00/282707058"><img title="Software Bugs" src="http://farm1.static.flickr.com/113/282707058_02305d3cce_m.jpg" alt="Software Bugs" height="211" width="240"></a><p class="wp-caption-text">Image by FastJack via Flickr</p></div>
</div>
<p>I&#8217;ve just updated MythPyWii to handle the connection to Mythfrontend more smoothly, and to give feedback via the wiimote on error/disconnect. (i.e. if myth closes, the wiimote shakes, and the LED pattern changes to [ . # # . ] instead of [ # . . # ] just before the wiimote turns itself off). This means if there are issues connecting to Mythfrontend you can retry again simply by pressing 1&amp;2 once more (fix any issues first though &#8211; e.g. closed mythfrontend/no remote interface enabled).</p>
<p>I&#8217;ve fixed a little bug with timestretching, and have also improved the timestretch responsiveness by emulating not just the left/right keys but also the up/down keys (which increase/decrease timestretch by 0.25 instead of just 0.05).</p>
<p>As always, download the latest version of MythPyWii <a href="http://www.benjiegillam.com/mythpywii-installation/">here</a>.</p>
<p>Ah hah, an update to <a class="zem_slink" title="Zemanta" rel="homepage" href="http://www.zemanta.com">Zemanta</a> has just been released! Integration with Facebook and Flickr, eh? I best sign up for a Flickr account then, I suppose&#8230; Argh! They seem to have broken images with my theme &#8211; I fixed it by adding this CSS to my theme (copied from firebug):</p>
<p><code class="source">
.alignright {
  float:right;
}

.wp-caption {
  -moz-border-radius-bottomleft:3px;
  -moz-border-radius-bottomright:3px;
  -moz-border-radius-topleft:3px;
  -moz-border-radius-topright:3px;
  background-color:#F3F3F3;
  border:1px solid #DDDDDD;
  margin:10px;
  padding-top:4px;
  text-align:center;
}
</code>
</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.zemanta.com/blog/new-release-my-friends-my-flickr-and-filter/">New release: My Friends, My Flickr and Filter</a></li>
<li class="zemanta-article-ul-li"><a href="http://blogs.talis.com/nodalities/2008/09/zemanta-gets-personal.php">Zemanta gets personal</a></li>
<li class="zemanta-article-ul-li"><a href="http://www.readwriteweb.com/archives/zemanta_releases_major_upgrade.php">Zemanta Releases Major Upgrade &#8211; Now It&#8217;s All About You</a></li>
</ul>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/0bc437ae-68b8-4224-93a6-1ff26b41280f/" title="Zemified by Zemanta"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_c.png?x-id=0bc437ae-68b8-4224-93a6-1ff26b41280f" alt="Reblog this post [with Zemanta]"></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.benjiegillam.com/2008/09/mythpywii-bugfixes-and-enhancements/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
