<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Techie</title>
	<atom:link href="http://techie.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://techie.wordpress.com</link>
	<description>Yet another technology blog from an Imperial College London student.</description>
	<lastBuildDate>Sun, 15 Jan 2012 00:31:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='techie.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Techie</title>
		<link>http://techie.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://techie.wordpress.com/osd.xml" title="Techie" />
	<atom:link rel='hub' href='http://techie.wordpress.com/?pushpress=hub'/>
		<item>
		<title>From iPhone to Android</title>
		<link>http://techie.wordpress.com/2010/07/08/from-iphone-to-android/</link>
		<comments>http://techie.wordpress.com/2010/07/08/from-iphone-to-android/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 18:10:11 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[htc desire]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://techie.wordpress.com/?p=132</guid>
		<description><![CDATA[Given the news that the new iPhone 4&#8242;s revolutionary external aerial system is all but useless, I have decided to jump ship and embrace the Android revolution. My new HTC Desire should be arriving within a few days time; just enough time for me to get to grips with Java.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=132&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Given the news that the new iPhone 4&#8242;s revolutionary external aerial system is all but useless, I have decided to jump ship and embrace the Android revolution. My new HTC Desire should be arriving within a few days time; just enough time for me to get to grips with Java.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techie.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techie.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techie.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techie.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techie.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techie.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techie.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techie.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techie.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techie.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techie.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techie.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techie.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techie.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=132&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techie.wordpress.com/2010/07/08/from-iphone-to-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0751f49013c1fc2e3d784b4518fa9e9a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">techie</media:title>
		</media:content>
	</item>
		<item>
		<title>Vodafone UK, an Unlocked iPhone and Internet Tethering</title>
		<link>http://techie.wordpress.com/2010/03/19/vodafone-uk-with-an-unlocked-iphone/</link>
		<comments>http://techie.wordpress.com/2010/03/19/vodafone-uk-with-an-unlocked-iphone/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 15:15:54 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[tethering]]></category>
		<category><![CDATA[vodafone]]></category>

		<guid isPermaLink="false">http://techie.wordpress.com/?p=120</guid>
		<description><![CDATA[My 18 month contract with O2 ended this last week and so for the last couple of weeks I have been exploring my options. I had already had the phone unlocked by O2 and as I won&#8217;t be upgrading for a while, I was after the best short term contract available. Vodafone&#8217;s £20/month SIM only deal [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=120&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My 18 month contract with O2 ended this last week and so for the last couple of weeks I have been exploring my options. I had already had the phone unlocked by O2 and as I won&#8217;t be upgrading for a while, I was after the best short term contract available. Vodafone&#8217;s £20/month SIM only deal offering 600 minutes, unlimited texts and 500MB mobile internet seemed to be my best bet. After quickly scanning the contract I noticed that they did not restrict how the data could be used, i.e. tethering should be possible. A quick phone call to their sales staff confirmed this, or so I thought.</p>
<p>After installing the new SIM, I quickly headed to the network settings to try out tethering. Instead of breathing new life into the phone however, the &#8216;Internet Tethering&#8217; button merely brought up a message informing me that the feature was not enabled and that I would have to contact Vodafone. Perhaps it needed a restart? No, it turns out that if you use the iPhone with one of the official carriers, then they must authorize it. Without jailbreaking the phone, which in hindsight might have been a better option, it is not possible to enable it even on an unlocked phone.</p>
<p>Given that I had already clarified with Vodafone that data could be used in any way, I gave them a call to request tethering be enabled. Perhaps unsurprisingly, the first assistant I spoke to said that this was not possible on a non-iPhone contract. I then had a relatively lengthy conversation with his supervisor who told me that the iPhone plans (which have tethering enabled) are set by Apple and their is no way that Vodafone can change these or offer any form discount. When I put it to her that customers who end their 18 month contracts will likely ask for a discount as the contract has been subsidising the phone, she said that a discount would be unlikely. Her manager however was able to give me a discount, not a perfect one admittedly, but an acceptable one.  For £20/month for 6 months I get 300 minutes, unlimited texts and 1GB data which can be used for tethering.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techie.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techie.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techie.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techie.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techie.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techie.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techie.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techie.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techie.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techie.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techie.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techie.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techie.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techie.wordpress.com/120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=120&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techie.wordpress.com/2010/03/19/vodafone-uk-with-an-unlocked-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0751f49013c1fc2e3d784b4518fa9e9a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">techie</media:title>
		</media:content>
	</item>
		<item>
		<title>Ultimate Ears MetroFi 220 Review</title>
		<link>http://techie.wordpress.com/2010/03/15/ultimate-ears-metrofi-220-review/</link>
		<comments>http://techie.wordpress.com/2010/03/15/ultimate-ears-metrofi-220-review/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 18:11:49 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[ultimate ears]]></category>

		<guid isPermaLink="false">http://techie.wordpress.com/?p=109</guid>
		<description><![CDATA[Introduction First off, I wouldn&#8217;t consider myself an audiophile but I dislike hearing music through cheap speakers. My HiFi consists of a pair of Bowers and Wilkins DM601s and I also have a pair of Sennheiser HD555 headphones. Whilst these are not the best on the market, they do sound exceptionally good. Usually I don&#8217;t listen to music [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=109&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>First off, I wouldn&#8217;t consider myself an audiophile but I dislike hearing music through cheap speakers. My HiFi consists of a pair of Bowers and Wilkins DM601s and I also have a pair of Sennheiser HD555 headphones. Whilst these are not the best on the market, they do sound exceptionally good. Usually I don&#8217;t listen to music on the go, but when I do the Senns aren&#8217;t suitable and as we all know the standard iPod earphones are simply terrible. For £17.99  I picked up a pair of Ultimate Ears MetroFi 220 from Play.com Ultimate Ears manufacture some of the most well respected IEMs on the market but the MetroFi are designed to capture to general consumer market who are looking for decent quality without breaking the bank.</p>
<h2>Comfort and Fit</h2>
<p>UE provide three sizes of eartip; small, medium and large. For me the medium were a perfect fit, however I can well believe that if none of the sizes are appropriate for you they may be quite disappointing. I wore the earphones on my train between London and Bristol which was about a 1:30 hour journey. They certainly did not block out all sound but they knocked out the sound of the train and attenuated people&#8217;s voices making the journey much more pleasant than it might otherwise have been. I was quite surprised at how noisy the carriage seemed when I took them out at the end of the journey. In terms of comfort, I found I very quickly forgot they were in and my ears did not feel sore at the end of the journey.</p>
<h2>Sound Quality</h2>
<p>As I have already stated, I am no audiophile so my review is purely my uneducated opinion. The frequency response of these IEMs is quite reasonable for a cheap pair of headphones, most of the treble and mids appear to be there and whilst the bass doesn&#8217;t reverberate around your head, it is reasonably respectful. In fairness, when I tried the Sennheiser CX500s I felt they were too bassy and hence unenjoyable. For listening rock, they are relatively balanced; vocals are clear, the guitars don&#8217;t sound too harsh and the bass guitar can be clearly heard but is not intrusive. Mozart&#8217;s Piano Sonatas certainly showed up the flaws in the treble, the phones sound almost murky and certainly don&#8217;t make for enjoyable listening. Film music was handled was handled better; some energy is certainly lost but there isn&#8217;t too much to complain about. Dance, Trance and Hip-hop fans will probably want a little bit more bass however for the casual listener I think they pretty good. The soundstage is certainly improved with auto panning effects incorporated into these genres.</p>
<h2>Conclusion</h2>
<p>Overall I would say the 220s are very good for £17.99, they certainly do not compare to Sennheiser HD555 but it would be madness to expect them too. They are a huge improvement over the standard iPod earbuds and for many people will probably represent a vastly superior sound. If the eartips fit your ears, the sound isolation is good and they are not uncomfortable. If I were to lose them I probably would replace them with a more expensive model such as the SuperFi 5s however the are over 3 times the price.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techie.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techie.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techie.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techie.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techie.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techie.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techie.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techie.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techie.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techie.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techie.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techie.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techie.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techie.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=109&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techie.wordpress.com/2010/03/15/ultimate-ears-metrofi-220-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0751f49013c1fc2e3d784b4518fa9e9a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">techie</media:title>
		</media:content>
	</item>
		<item>
		<title>Warning about the ADXL335 and the Arduino</title>
		<link>http://techie.wordpress.com/2010/02/21/warning-about-the-adxl335-and-the-arduino/</link>
		<comments>http://techie.wordpress.com/2010/02/21/warning-about-the-adxl335-and-the-arduino/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 18:49:03 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[arduino]]></category>
		<category><![CDATA[adxl3xx]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://techie.wordpress.com/?p=103</guid>
		<description><![CDATA[SparkFun have an excellent range of accelerometer breakout boards for hobbyists, mostly based on the ADXL3xx series of chips. The vast majority of these are happy to run at 2.4V-5.25V and so can easily be plugged directly into the Arduino. Unfortunately the ADXL335, which I believe to be the newest and cheapest chip, does not [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=103&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SparkFun have an excellent range of <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=847">accelerometer breakout boards</a> for hobbyists, mostly based on the ADXL3xx series of chips. The vast majority of these are happy to run at 2.4V-5.25V and so can easily be <a href="http://www.arduino.cc/en/Tutorial/ADXL3xx">plugged directly into the Arduino</a>. Unfortunately the ADXL335, which I believe to be the newest and cheapest chip, does not accept any higher than 3.3V.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techie.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techie.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techie.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techie.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techie.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techie.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techie.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techie.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techie.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techie.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techie.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techie.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techie.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techie.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=103&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techie.wordpress.com/2010/02/21/warning-about-the-adxl335-and-the-arduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0751f49013c1fc2e3d784b4518fa9e9a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">techie</media:title>
		</media:content>
	</item>
		<item>
		<title>Interfacing the Arduino with Matlab Using Events</title>
		<link>http://techie.wordpress.com/2010/02/12/interfacing-the-arduino-with-matlab-using-events/</link>
		<comments>http://techie.wordpress.com/2010/02/12/interfacing-the-arduino-with-matlab-using-events/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 19:16:52 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[matlab]]></category>

		<guid isPermaLink="false">http://techie.wordpress.com/?p=86</guid>
		<description><![CDATA[Opening a basic serial connection to the Arduino in Matlab is not difficult and is documented. Data is sent to the device using the fprintf() function and received using fscanf(). If we have data continually being sent by our device there are two ways of capturing it. We can create a loop within Matlab to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=86&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Opening a basic serial connection to the Arduino in Matlab is not difficult and is <a href="http://www.arduino.cc/playground/Interfacing/Matlab">documented</a>. Data is sent to the device using the fprintf() function and received using fscanf().</p>
<p><pre class="brush: matlabkey;">
s = serial('COM3', 'BaudRate', 9600);
fopen(s);
fprintf(s, 'Hello World!');
line = fscanf(s);
fclose(s);
</pre></p>
<p>If we have data continually being sent by our device there are two ways of capturing it. We can create a loop within Matlab to constantly check if any data has been received however this doesn&#8217;t seem like brilliant coding practise. Alternatively we can make use of the Matlab&#8217;s BytesAvailable event and read the input buffer only when data is received.</p>
<p>Unfortunately, unlike languages like C++, Matlab is only able to pass variables by value and not by reference. So if we create an array in our workspace to hold the received data, our callback function will be unable to update it. However in Matlab it is possible to nest functions within the body of another. The variables defined in the outer function will be accessible to the inner function.</p>
<p><pre class="brush: matlabkey;">
% Calling the function myFunc will display the number 10.
% Demonstrates that nested function has access to variables.
function myFunc

    myVar = 10;

    innerFunc()

    function innerFunc
        myVar
    end

end
</pre></p>
<p>The code to establish a serial connection is written into a Matlab function which also contain an array of all received data. The callback function of the BytesAvailable event is defined as a nested function and hence  can add to the data array when new data is received. This allows us to perform analysis on the data in parallel to it being read.</p>
<p>The full sourcecode of my function is shown below:<br />
<span id="more-86"></span></p>
<p><pre class="brush: matlabkey;">
%
%   SerialArduino
%
%   Makes a serial connection via COM3 to the Arduino. Uses the
%   BytesAvailableFcn event to trigger a function to record data sent by
%   device. The recorded value and time are stored in the vectors values
%   and times respectively.
%
%   Inputs: Time (in seconds) to listen to device.
%   Outputs: Times and Values
%
%   Tested in Matlab 2009b
%
%   Written 12 February 2010
%   by Leo Kent
%
%   http://leo.me.uk/
%
function [times values] = SerialArduino (time)

    % Declare the vectors to hold time and value data.
    times = zeros(0,1);
    values = zeros(0,1);

    % Setup serial connection.
    ser = serial('COM3', 'BaudRate', 9600);

    % Attach the callback function.
    ser.BytesAvailableFcnMode = 'terminator';
    ser.BytesAvailableFcn = @Callback;

    % Open the connection.
    fopen(ser);

    % Record the time at which we open the connection.
    start_time = tic;

    % This is the callback function for when bytes are availble.
    % It adds the received value to the values array and gets time.
    function Callback(obj, event)

        % Get the new values.
        v = str2double(fscanf(obj));
        t = toc(start_time);

        % Update the vectors.
        values = [values; v];
        times = [times; t];

    end

    % Wait 5 seconds and close connection.
    time = 5;
    pause(time);

    % Close the serial port connection.
    fclose(ser);

    % Plot the output.
    plot(times, values);

end
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techie.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techie.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techie.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techie.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techie.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techie.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techie.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techie.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techie.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techie.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techie.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techie.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techie.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techie.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=86&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techie.wordpress.com/2010/02/12/interfacing-the-arduino-with-matlab-using-events/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0751f49013c1fc2e3d784b4518fa9e9a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">techie</media:title>
		</media:content>
	</item>
		<item>
		<title>Arduino: Setting Delay Time via Serial Input</title>
		<link>http://techie.wordpress.com/2010/02/12/arduino-setting-delay-time-via-serial-input/</link>
		<comments>http://techie.wordpress.com/2010/02/12/arduino-setting-delay-time-via-serial-input/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 16:14:26 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://techie.wordpress.com/?p=64</guid>
		<description><![CDATA[There are plenty of tutorials explaining how to make an LED turn on for a pre-set period of time using the Arduino. However I have come across none which allow us to set the delay time using serial communication. As it turns out, getting an integer value from serial input is a little more complex than one might [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=64&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are plenty of tutorials explaining how to make an LED turn on for a pre-set period of time using the Arduino. However I have come across none which allow us to set the delay time using serial communication. As it turns out, getting an integer value from serial input is a little more complex than one might first think. To understand why, we must first understand how serial communication works.</p>
<p>Serial transfer is where we send each bit of data sequentially, one after another. The Arduino stores each byte (8 bits) it receives into its input buffer array. When we call the Serial.read() function, we grab one byte form the input buffer. So, if we send the number 100 we will read a one followed by a zero followed by another zero. To make things a little more confusing, each number will be ASCII encoded. We must convert each received byte to an integer and then join each individual integer into one value.</p>
<p>After a few attempts to concatenate integers,  I came across <a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1264962652" target="_blank">this</a> insightful post on the <a href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl">Arduino forums</a>. The following code is adapted from the code suggested by user PaulS.</p>
<p><pre class="brush: cpp;">
value = 0;

while (Serial.available() &gt; 0)
{
  value *= 10;
  value += (Serial.read() - '0');
  delay(1); 
}
</pre></p>
<p>We start by initializing an integer to zero, this will hold our read value. Within the while loop, the value is multiplied by 10 to shift the place value of the digits to the left. In line 6, we subtract the ASCII value of character zero (48) from the input byte (which we know is ASCII encoded) and hence obtain a numeric value. It should be noted that each number is placed in the units column and then shifted to the left each time another value is added.</p>
<p>I found that at a baud rate of 9600, the Arduino was executing the run loop faster than the serial bytes were being received. As a result if I sent the number 100, the while loop only ran once and so the value was set to 1. The one ms delay gives the Arduino time to receive the next byte.</p>
<p>Full source code is provided below:<br />
<span id="more-64"></span><br />
<pre class="brush: cpp;">
/*
*  Serial Delay
*
*  Reads value from serial input and stores it as an integer.
*  Switches an LED on for the number of milliseconds defined
*  by the integer.
*
*  Note: Does not check to see if input is numeric.
*
*  By Leo Kent
*  Created 11 February 2010
*
*  http://leo.me.uk/
*/

// Declare a variable to hold the delay value.
int value;

void setup()
{
  // Begin serial communication at a baud rate of 9600.
  Serial.begin(9600);
  
  // Set pin 13 as an output.
  pinMode(13, OUTPUT);
}

void loop()
{
  // Check to see if serial data is available.
  if (Serial.available() &gt; 0)
  {    
    // (Re)set the value to zero.
    value = 0;
    
    // Append each byte to the delay value integer.
    while(Serial.available() &gt; 0)
    {
      value *= 10;
      value += (Serial.read() - '0');
      delay(1); // Give the AVR time to receive all bytes.
    }
    
    Serial.println(value);
    
    // Turn the LED on.
    digitalWrite(13, HIGH);
    
    // Delay by the requested number of ms.
    delay(value);
    
    // Turn the LED off.
    digitalWrite(13, LOW);
  }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techie.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techie.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techie.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techie.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techie.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techie.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techie.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techie.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techie.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techie.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techie.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techie.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techie.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techie.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=64&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techie.wordpress.com/2010/02/12/arduino-setting-delay-time-via-serial-input/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0751f49013c1fc2e3d784b4518fa9e9a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">techie</media:title>
		</media:content>
	</item>
		<item>
		<title>Essential Electronics iPhone App</title>
		<link>http://techie.wordpress.com/2010/02/10/essential-electronics-iphone-app/</link>
		<comments>http://techie.wordpress.com/2010/02/10/essential-electronics-iphone-app/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 22:08:04 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://techie.wordpress.com/?p=55</guid>
		<description><![CDATA[If, like me, you find yourself struggling to remember the colour codes for resistors, then you need the ResistorCC app for the iPhone. Unfortunately the free version doesn&#8217;t have reverse lookup though this isn&#8217;t much of a limitation. Check out the screenshot below&#8230;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=55&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If, like me, you find yourself struggling to remember the colour codes for resistors, then you need the <a href="http://itunes.apple.com/gb/app/resistor-color-code/id322001850" target="_blank">ResistorCC</a> app for the iPhone. Unfortunately the free version doesn&#8217;t have reverse lookup though this isn&#8217;t much of a limitation. Check out the screenshot below&#8230;</p>
<p><span id="more-55"></span></p>
<p><a href="http://techie.files.wordpress.com/2010/02/resistorcc1.jpg"><img class="aligncenter size-full wp-image-58" title="ResistorCC" src="http://techie.files.wordpress.com/2010/02/resistorcc1.jpg?w=480" alt="ResistorCC App"   /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techie.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techie.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techie.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techie.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techie.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techie.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techie.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techie.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techie.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techie.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techie.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techie.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techie.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techie.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=55&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techie.wordpress.com/2010/02/10/essential-electronics-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0751f49013c1fc2e3d784b4518fa9e9a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">techie</media:title>
		</media:content>

		<media:content url="http://techie.files.wordpress.com/2010/02/resistorcc1.jpg" medium="image">
			<media:title type="html">ResistorCC</media:title>
		</media:content>
	</item>
		<item>
		<title>The Arduino</title>
		<link>http://techie.wordpress.com/2010/02/10/the-arduino/</link>
		<comments>http://techie.wordpress.com/2010/02/10/the-arduino/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 18:55:59 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[arduino]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://techie.wordpress.com/?p=46</guid>
		<description><![CDATA[So I have finally succumbed to temptation and bought myself an Arduino Duemilanove from eBay. Having previously played around with AVRs, the range of microprocessors which power the board, they seem extremely easy to use. I&#8217;m still playing around with the device at the moment, but expect updates soon!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=46&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://techie.files.wordpress.com/2010/02/arduino.jpg"><img class="aligncenter size-full wp-image-47" title="Arduino Duemilanove" src="http://techie.files.wordpress.com/2010/02/arduino.jpg?w=480" alt="Arduino Duemilanove"   /></a></p>
<p>So I have finally succumbed to temptation and bought myself an <a href="http://www.arduino.cc/" target="_blank">Arduino</a> <a href="http://www.arduino.cc/en/Main/ArduinoBoardDuemilanove" target="_blank">Duemilanove</a> from eBay. Having previously played around with AVRs, the range of microprocessors which power the board, they seem extremely easy to use. I&#8217;m still playing around with the device at the moment, but expect updates soon!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techie.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techie.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techie.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techie.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techie.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techie.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techie.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techie.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techie.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techie.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techie.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techie.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techie.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techie.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=46&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techie.wordpress.com/2010/02/10/the-arduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0751f49013c1fc2e3d784b4518fa9e9a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">techie</media:title>
		</media:content>

		<media:content url="http://techie.files.wordpress.com/2010/02/arduino.jpg" medium="image">
			<media:title type="html">Arduino Duemilanove</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Stackless Python on Debian Lenny</title>
		<link>http://techie.wordpress.com/2009/07/14/installing-stackless-python-on-debian-lenny/</link>
		<comments>http://techie.wordpress.com/2009/07/14/installing-stackless-python-on-debian-lenny/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 22:50:42 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://techie.wordpress.com/?p=19</guid>
		<description><![CDATA[If you haven&#8217;t already heard of Stackless Python and you are creating highly concurrent applications then you must check it out. Unfortunately, Stackless is not available on the Debain repositories so must be compiled from source. The following entry documents my method to get Stackless installed on a production server. Before we begin downloading and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=19&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t already heard of <a href="http://www.stackless.com/">Stackless Python</a> and you are creating highly concurrent applications then you must check it out. Unfortunately, Stackless is not available on the Debain repositories so must be compiled from source. The following entry documents my method to get Stackless installed on a production server.</p>
<p><span id="more-19"></span>Before we begin downloading and building the source code there are a few dependencies we must install. I shall be using subversion to obtain the latest version of the source. The build essential package contains the various tools need to compile from source. Although not actually required, checkinstall creates a Debain package file and adds the installation to the package database allowing for easy removal. Finally, a stock version of Python is required for the build to be successful. To install these dependencies, issue the following command (as root).<br />
<pre class="brush: bash;">apt-get install subversion build-essential checkinstall python</pre><br />
By default, Lenny ships with Python 2.52 so we shall grab the 2.52 version of Stackless using the this command (as a normal user).<br />
<pre class="brush: bash;">svn checkout http://svn.python.org/projects/stackless/tags/python-2.52/</pre><br />
Next we need to move folder subversion has created and build the software. Issue the following commands as a normal user.<br />
<pre class="brush: bash;">cd python-2.52
./configure
make</pre><br />
Finally we can install Stackless. Although you can just run make install, as I have already suggested I prefer to use checkinstall. The following command should be run as root.<br />
<pre class="brush: bash;">checkinstall -D make install</pre><br />
Checkinstall runs through a few options, it is safe to leave all of these as default however I advise entering a reasonable description.</p>
<p>If all has gone well, you should now have Stackless Python installed. Please be aware that the stock version of Python installed from the repositories will have been overwritten. It is likely that if the package is updated then our Stackless build will be overwritten.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techie.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techie.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techie.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techie.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techie.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techie.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techie.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techie.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techie.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techie.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techie.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techie.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techie.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techie.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techie.wordpress.com&amp;blog=5850&amp;post=19&amp;subd=techie&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techie.wordpress.com/2009/07/14/installing-stackless-python-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0751f49013c1fc2e3d784b4518fa9e9a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">techie</media:title>
		</media:content>
	</item>
	</channel>
</rss>
