<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 - Entries tagged with Hardware</title>
    <atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Tags/hardware/RSS"></atom:link>
    <itunes:summary></itunes:summary>
    <itunes:author>Microsoft</itunes:author>
    <itunes:subtitle></itunes:subtitle>
    <image>
      <url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
      <title>Channel 9 - Entries tagged with Hardware</title>
      <link>http://channel9.msdn.com/Tags/hardware</link>
    </image>
    <itunes:image href=""></itunes:image>
    <itunes:category text="Technology"></itunes:category>
    <description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
    <link>http://channel9.msdn.com/Tags/hardware</link>
    <language>en</language>
    <pubDate>Tue, 21 May 2013 18:43:24 GMT</pubDate>
    <lastBuildDate>Tue, 21 May 2013 18:43:24 GMT</lastBuildDate>
    <generator>Rev9</generator>
    <c9:totalResults>177</c9:totalResults>
    <c9:pageCount>8</c9:pageCount>
    <c9:pageSize>25</c9:pageSize>
  <item>
      <title>.NET Gadgeteer Core gets VS2012 support in v2.42.700</title>
      <description><![CDATA[<p>Today's Hardware Friday is about one of our favorite hardware things, the .NET Gadgeteer and its updated Code release...</p><h2><a href="https://gadgeteer.codeplex.com/releases/view/105366">.NET Gadgeteer Core 2.42.700</a></h2><blockquote><p>The .NET Gadgeteer Core installer includes the core libraries and end user project templates for Microsoft .NET Gadgeteer. This is a prerequisite for end users to build and deploy .NET Gadgeteer projects. It includes a project template wizard in the New Project dialog in Visual Studio 2012 or 2010 (or express versions) under the Gadgeteer tab - &quot;.NET Gadgeteer Application&quot;. This template uses a graphical designer built for Visual Studio which allows end users to visually configure .NET Gadgeteer hardware builds and then write the software logic for that hardware in C# or Visual Basic.</p><p>The .NET Gadgeteer Builder Templates installer is for hardware vendors who are building modules, mainboards or kits comprising multiple modules/mainboards. This adds additional project templates for modules, mainboards and kits. Each template includes instructions on how to use it, and automatically builds an MSI installer which can be distributed to end users.</p><p>If you are a prospective module or mainboard builder you should also look at the Module Builder's Guide and Mainboard Builder's Guide, which includes the full specifications for what it means to be &quot;.NET Gadgeteer compatible&quot; and other helpful examples and guidelines.</p><p>Neither installer includes libraries for specific hardware modules/mainboards, so by themselves these installers do not enable users to use .NET Gadgeteer hardware. Hardware manufacturers should release installers (based on the templates above) for their hardware.</p><p>================================================================<br>Microsoft .NET Gadgeteer Core <br>RELEASE NOTES<br>Version 2.42.700 19 April 2013<br>...</p><p>================================================================<br>Change Log<br>================================================================<br>Version 2.42.700, 19 April 2013<br>MAJOR CHANGES</p><ul><li>VS 2012 support (if using NETMF 4.3 SDK) added alongside VS 2010 support (using NETMF 4.2 or earlier) (When using VS 2012 you can target NETMF 4.2 or 4.1 devices too) </li><li>Visual Studio Express 2012 for Windows Desktop support (and older 2010 Express version support maintained) </li><li>Application template wizard which checks for compatibility between VS, NETMF SDK and mainboard </li><li>Power consumption data is specifiable in GadgeteerHardware.xml schema and shown in VS designer </li></ul><p>MINOR CHANGES</p><ul><li>Socket type D and H compatibility check fixed </li><li>Managed software I2C (used by DaisyLink) uses repeated start condition when appropriate </li><li>Added StorageDevice.DeleteDirectory method and fixed StorageDevice.Delete to delete files </li><li>Text templates no longer used by designer, avoiding permissions warning </li><li>License updated to clarify that VS extensions are binary-only </li></ul><p>**** ALPHA SUPPORT *****<br>This release also includes alpha support for the following. This is for evaluation purposes only, and features may change.</p><ul><li>NETMF 4.3, with feature changes: </li><li>AnalogOutput uses NETMF native support </li></ul><p>...</p></blockquote><p>And remember, the source for all of this, and even some 3D models, are available;</p><p><a href="https://gadgeteer.codeplex.com/SourceControl/BrowseLatest"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B3%5D-89.png" alt="image" width="295" height="364" border="0"></a><a href="https://gadgeteer.codeplex.com/SourceControl/BrowseLatest"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B7%5D-37.png" alt="image" width="272" height="364" border="0"></a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:147839a9555f401ab193a1a601689e74">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/NET-Gadgeteer-Core-gets-VS2012-support-in-v242700</comments>
      <itunes:summary>Today&#39;s Hardware Friday is about one of our favorite hardware things, the .NET Gadgeteer and its updated Code release... .NET Gadgeteer Core 2.42.700The .NET Gadgeteer Core installer includes the core libraries and end user project templates for Microsoft .NET Gadgeteer. This is a prerequisite for end users to build and deploy .NET Gadgeteer projects. It includes a project template wizard in the New Project dialog in Visual Studio 2012 or 2010 (or express versions) under the Gadgeteer tab - &amp;quot;.NET Gadgeteer Application&amp;quot;. This template uses a graphical designer built for Visual Studio which allows end users to visually configure .NET Gadgeteer hardware builds and then write the software logic for that hardware in C# or Visual Basic. The .NET Gadgeteer Builder Templates installer is for hardware vendors who are building modules, mainboards or kits comprising multiple modules/mainboards. This adds additional project templates for modules, mainboards and kits. Each template includes instructions on how to use it, and automatically builds an MSI installer which can be distributed to end users. If you are a prospective module or mainboard builder you should also look at the Module Builder&#39;s Guide and Mainboard Builder&#39;s Guide, which includes the full specifications for what it means to be &amp;quot;.NET Gadgeteer compatible&amp;quot; and other helpful examples and guidelines. Neither installer includes libraries for specific hardware modules/mainboards, so by themselves these installers do not enable users to use .NET Gadgeteer hardware. Hardware manufacturers should release installers (based on the templates above) for their hardware. ================================================================Microsoft .NET Gadgeteer Core RELEASE NOTESVersion 2.42.700 19 April 2013... ================================================================Change Log================================================================Version 2.42.700, 19 April 2013MAJOR CHANGES VS 2012 support (</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/NET-Gadgeteer-Core-gets-VS2012-support-in-v242700</link>
      <pubDate>Fri, 26 Apr 2013 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/NET-Gadgeteer-Core-gets-VS2012-support-in-v242700</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/8a22e28a-d379-47f7-9ef6-89dca09259a2.png" height="62" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/fbda8170-8e1f-401b-97a1-a864fba2dddb.png" height="135" width="220"></media:thumbnail>      
      <dc:creator>Greg Duncan</dc:creator>
      <itunes:author>Greg Duncan</itunes:author>
      <slash:comments>1</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/NET-Gadgeteer-Core-gets-VS2012-support-in-v242700/RSS</wfw:commentRss>
      <category>.NET Micro Framework</category>
      <category>Coding4Fun</category>
      <category>Hardware</category>
    </item>
  <item>
      <title>I&#39;m thinking of... Mindwave + Arduino [&quot;ThinkUino&quot;]</title>
      <description><![CDATA[<p>Today's Hardware Friday takes back to one of my favorite areas (okay, yeah I have a bunch of those, but still), mind to PC interfaces. I can't wait for the day when I can ditch my keyboard, mouse, voice, touch, gesture devices and just think at my PC. Talk about a &quot;natural interface!&quot; Sure, we're a ways away from that, but hey, a guy can dream.</p><p>Here's a few of the past posts;</p><ul><li><a href="http://channel9.msdn.com/coding4fun/blog/Controlling-a-NET-Gadgeteer-Device-with-your-mind">Controlling a .NET Gadgeteer Device with your mind...</a> </li><li><a href="http://channel9.msdn.com/coding4fun/blog/Mind-Control-with-C-and-the-Emotiv-and-Emotiv-Engine-Client-Library">Mind Control with C# (and the Emotiv and Emotiv Engine Client Library)</a> </li><li><a href="http://channel9.msdn.com/coding4fun/blog/Its-as-if-it-can-read-your-mind">It's as if it can read your mind...</a> </li></ul><p>Today we show off Antonio Blescia's work in his ThinkUino project.</p><h2><a href="http://www.codeproject.com/Articles/567963/ThinkUino-Project">ThinkUino Project</a></h2><blockquote><p>ThinkUino (Thinking Arduino) is an open source project that allows to connect the Arduino board with Mindwave headset. The cognitive application opens new frontiers for control the electronic circuits through&nbsp; the reading of brainwaves. With this article I explain how to make a cognitive application for control a single LED light.</p><p><strong>Mindwave... what is it?</strong></p><p>Mindwave is an innovative headset produced by Neurosky. Mindwave converts the brainwaves into digital electronic signals. There are two version of this device:&nbsp;&nbsp;&nbsp;</p><ul><li>Mindwave Headset: is the basic configuration of Mindwave. It can be connected only to pc for reading data only with Neurosky applications. Its color is white. You can buy it from this link: <a href="http://store-eu.neurosky.com/collections/hardware/products/mindwave-1">http://store-eu.neurosky.com/collections/hardware/products/mindwave-1</a> </li><li>Mindwave Mobile Headset: this version allow to connect with mobile device through bluetooth SPP communication. This device retrieves the brainwaves with more precision. This device, than, can be connected to Android and iOS operating system. Its color is black. You can buy it form this link: <a href="http://store-eu.neurosky.com/collections/hardware/products/mindwave-mobile">http://store-eu.neurosky.com/collections/hardware/products/mindwave-mobile</a> </li></ul><p><strong>Mindwave... two versions, but which i should choose?</strong></p><p>For the scope of this project the Mindwave Mobile is indispensable. That device supports the bluetooth connection, through the bluetooth connection it send the data in RAW mode to the connected devices. With the retrieved data we can parse the various frequency reading by the headset.&nbsp;</p><p><strong>What do I need to implement this project?</strong></p><p>The fundamental elements to create this project are:&nbsp;&nbsp;</p><ol><li>Mindwave Mobile Headset&nbsp; </li><li>Arduino 2009 or higher&nbsp; </li><li>Led&nbsp;&nbsp; </li></ol><p><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B5%5D-66.png" alt="image" width="273" height="364" border="0">&nbsp;<img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B2%5D-126.png" alt="image" width="243" height="364" border="0"></p><p>...</p></blockquote><p>Best of all is the code is all C# and looks pretty simple (as must code does in hindsight <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /></p><p><img title="SNAGHTML589cf8b" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/SNAGHTML589cf8b%5B3%5D.png" alt="SNAGHTML589cf8b" width="500" height="256" border="0"></p><p>The device's price seems reasonable, the <a href="http://store.neurosky.com/products/brainwave-starter-kit">Brainwave Starter Kit</a> is currently $99, it's <a href="http://store.neurosky.com/products/developer-tools-2-1">developer tools</a> are free and this project shows just a glimpse of how you can start turning it into the &quot;Internet of [Mind] Things&quot;... <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:25b95de34bfd44ca9c37a19801693933">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/Im-thinking-of-Mindwave--Arduino-ThinkUino</comments>
      <itunes:summary>Today&#39;s Hardware Friday takes back to one of my favorite areas (okay, yeah I have a bunch of those, but still), mind to PC interfaces. I can&#39;t wait for the day when I can ditch my keyboard, mouse, voice, touch, gesture devices and just think at my PC. Talk about a &amp;quot;natural interface!&amp;quot; Sure, we&#39;re a ways away from that, but hey, a guy can dream. Here&#39;s a few of the past posts; Controlling a .NET Gadgeteer Device with your mind... Mind Control with C# (and the Emotiv and Emotiv Engine Client Library) It&#39;s as if it can read your mind... Today we show off Antonio Blescia&#39;s work in his ThinkUino project. ThinkUino ProjectThinkUino (Thinking Arduino) is an open source project that allows to connect the Arduino board with Mindwave headset. The cognitive application opens new frontiers for control the electronic circuits through&amp;nbsp; the reading of brainwaves. With this article I explain how to make a cognitive application for control a single LED light. Mindwave... what is it? Mindwave is an innovative headset produced by Neurosky. Mindwave converts the brainwaves into digital electronic signals. There are two version of this device:&amp;nbsp;&amp;nbsp;&amp;nbsp; Mindwave Headset: is the basic configuration of Mindwave. It can be connected only to pc for reading data only with Neurosky applications. Its color is white. You can buy it from this link: http://store-eu.neurosky.com/collections/hardware/products/mindwave-1 Mindwave Mobile Headset: this version allow to connect with mobile device through bluetooth SPP communication. This device retrieves the brainwaves with more precision. This device, than, can be connected to Android and iOS operating system. Its color is black. You can buy it form this link: http://store-eu.neurosky.com/collections/hardware/products/mindwave-mobile Mindwave... two versions, but which i should choose? For the scope of this project the Mindwave Mobile is indispensable. That device supports the bluetooth connection, through the bluetooth connecti</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/Im-thinking-of-Mindwave--Arduino-ThinkUino</link>
      <pubDate>Fri, 12 Apr 2013 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/Im-thinking-of-Mindwave--Arduino-ThinkUino</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/bb7f2fe7-e8bc-48ab-b7d2-cef28bc25d38.png" height="78" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/fef45471-60e7-4341-9879-6638fa1b7070.png" height="172" width="220"></media:thumbnail>      
      <dc:creator>Greg Duncan</dc:creator>
      <itunes:author>Greg Duncan</itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/Im-thinking-of-Mindwave--Arduino-ThinkUino/RSS</wfw:commentRss>
      <category>C#</category>
      <category>Coding4Fun</category>
      <category>Hardware</category>
      <category>Arduino </category>
    </item>
  <item>
      <title>Philips Hue Lighting Controller</title>
      <description><![CDATA[<h3><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image002%5B3%5D-9.jpg"><img title="clip_image002" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image002_thumb-10.jpg" alt="clip_image002" width="605" height="341" border="0"></a></h3><p>So Philips recently introduced their Hue Connected Bulbs: an easy-to-use set of LED light bulbs and Wi-Fi connected bridge which allows you to dynamically change the color of your home lighting using their iOS or Android app. What’s particularly cool is that the bridge has a web API which you can access to set the colors of each bulb with your own app.</p><p>We at <a href="http://untitlednet.com">untitled network</a> developed our own Philips Hue app called Oni: light Control, which is&nbsp;currently available on the <a href="http://www.windowsphone.com/en-us/store/app/oni-light-control/c8199c0b-3976-4a3b-9275-2d3a803f68ab">Windows Phone Store</a>. In addition to allowing you to set the color of your home lighting with defined “Moods”, the app also allows you to do the same using your phone’s built in voice commands or inexpensive NFC stickers. Here’s a demo of the Oni: Light Control in action:</p><p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/bJUqLPvlJS0&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/bJUqLPvlJS0&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p><p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/n00gZqQj5wk&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/n00gZqQj5wk&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p><p>I’m going to show you how you can develop your own app using the color picker from the Coding4Fun Toolkit for Windows Phone and the Json.Net library from Newtonsoft. These libraries can be found on NuGet, but you’ll obviously need the Philips Hue Connected Bulbs kit to test things out.</p><p><strong>Getting Started:</strong></p><p>The Philips Hue API uses a restful JSON interface you can access using any http client. Documentation on all of the supported methods by the Philips Hue bridge can be found at <a href="http://blog.ef.net/2012/11/02/philips-hue-api.html">http://blog.ef.net/2012/11/02/philips-hue-api.html</a>.</p><p>To get started, you’ll need authorized access to your bridge’s API. Once the bridge has successfully established a network connection with your router, discover its internal IP address via the URL: <a href="http://www.meethue.com/api/nupnp">http://www.meethue.com/api/nupnp</a></p><p>You should get a response similar to:</p><p><pre class="brush: csharp">[{&quot;id&quot;:&quot;ffss00fffe123456&quot;,&quot;internalipaddress&quot;:&quot;192.168.1.100&quot;,&quot;macaddress&quot;:&quot;0aa:bb:cc:dd:00:11&quot;}]
</pre></p><p>Note the internalipaddress value and use the IP to access the bridge’s API directly the with the URL <a href="http://192.168.1.100/api">http://192.168.1.100/api</a></p><p>Now, since we haven’t registered a user for authorization, attempting to access the hub will return an error from the bridge:</p><p><pre class="brush: csharp">
[{&quot;error&quot;:{&quot;type&quot;:1,&quot;address&quot;:&quot;/&quot;,&quot;description&quot;:&quot;unauthorized user&quot;}}]
</pre></p><p>To register a new user, we’ll first POST the username we wish to use.</p><p><pre class="brush: csharp">
var client = new WebClient();
 
//our uri to perform registration
var uri = new Uri(string.Format(&quot;http://{0}/api&quot;, HostnameTextBox.Text));
 
//create our registration object, along with username and description
var reg = new
{
    username = UsernameTextBox.Text,
    devicetype = &quot;Coding4Fun Hue Light Project&quot;
};
 
var jsonObj = JsonConvert.SerializeObject(reg);
 
 
//decide what to do with the response we get back from the bridge
client.UploadStringCompleted &#43;= (o, args) =] Dispatcher.BeginInvoke(() =]
{
    try
    {
        ResponseTextBox.Text = args.Result;
    }
    catch (Exception ex)
    {
        ResponseTextBox.Text = ex.Message;
    }
});
 
//Invoke a POST to the bridge
client.UploadStringAsync(uri, jsonObj);
</pre></p><p>Note the response we get back from our hub will be</p><p><pre class="brush: csharp">
[{&quot;error&quot;:{&quot;type&quot;:101,&quot;address&quot;:&quot;&quot;,&quot;description&quot;:&quot;link button not pressed&quot;}}]
</pre></p><p>This is because bridge requires you to first push the link button before new registrations can be made. After pushing the button and invoking the registration function again, you should receive the following result from the bridge:</p><p><pre class="brush: csharp">
[{&quot;success&quot;:{&quot;username&quot;:&quot;coding4fun&quot;}}]
</pre></p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/settingScreen%5B2%5D.png"><img title="settingScreen" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/settingScreen_thumb.png" alt="settingScreen" width="288" height="480" border="0"></a></p><p><strong>Setting the Bulb Color:</strong></p><p>We should now be able to access all methods on the bridge. You can get all of the configuration details, including all of the bulbs and their statuses with the same base url: <a href="http://192.168.1.100/api/coding4fun">http://192.168.1.100/api/coding4fun</a></p><p>Now comes the fun part. There are three color modes in which you can use to set the color of your bulbs:</p><ul><li><strong>hue &amp; sat:</strong> ‘hue’ is a color range between 0-65535 which represent 182.04*degrees, ‘sat’ is saturation with a range of 0-254 </li><li><strong>xy:</strong> are coordinates in the CIE 1931 space </li><li><strong>ct:</strong> is a color temperature expressed in mireds from 154 to 500, coolest to warmest respectfully </li></ul><p><em>Source: </em><a href="http://rsmck.co.uk/hue"><em>http://rsmck.co.uk/hue</em></a></p><p>We’ll be setting the colors of our bulbs using hue &amp; saturation parameters. Luckily, the Coding4Fun Toolkit for Windows Phone has three awesome color picker controls and some useful color extensions which makes setting the bulb colors a breeze. We start by building our state object – a list of parameters we want our bulb to be set to. Then we use the PUT verb to set the light with the following URL: http://{BRIGE-IPADDRESS}/api/coding4fun/lights/1/state</p><p>The “1” in the url is the 1-based index of the bulb you want to set.</p><p><pre class="brush: csharp">
//Get the HSV Value from the currently selected color
var hsv = LightColorSlider.Color.GetHSV();
 
//build our State object
var state = new
{
    on = true,
    hue = (int)(hsv.Hue * 182.04), //we convert the hue value into degrees by multiplying the value by 182.04
    sat = (int)(hsv.Saturation * 254)
};
 
//convert it to json:
var jsonObj = JsonConvert.SerializeObject(state);
 
//set the api url to set the state
var uri = new Uri(string.Format(&quot;http://{0}/api/{1}/lights/{2}/state&quot;, HostnameTextBox.Text, UsernameTextBox.Text, LightIndexTextBox.Text));
 
var client = new WebClient();
 
//decide what to do with the response we get back from the bridge
client.UploadStringCompleted &#43;= (o, args) =&gt; Dispatcher.BeginInvoke(() =&gt;
{
    try
    {
        ResponseTextBox.Text = args.Result;
    }
    catch (Exception ex)
    {
        ResponseTextBox.Text = ex.Message;
    }
     
});
 
//Invoke the PUT method to set the state of the bulb
client.UploadStringAsync(uri, &quot;PUT&quot;, jsonObj);
</pre></p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/colorScreen%5B2%5D.png"><img title="colorScreen" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/colorScreen_thumb.png" alt="colorScreen" width="288" height="480" border="0"></a></p><p>That’s it! Be sure to check out all of the other functions the (other functions the Hue API supports) at <a href="http://developers.meethue.com/index.html">http://developers.meethue.com/index.html</a></p><p><strong>Bio</strong>:<br><a href="http://channel9.msdn.com/Niners/unt1tled">Jarem Archer</a> is a self-taught Software Developer and UX Designer. He’s part of a small team at <a href="http://untitlednet.com">untitled network</a> who have a passion for video games, digital motion, entertainment and gadgets. Follow him on Twitter at <a href="http://twitter.com/unt1tled">http://twitter.com/unt1tled</a>.</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:5f2b34e566b542fb8fefa1860129d903">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Philips-Hue-Lighting-Controller</comments>
      <itunes:summary>So Philips recently introduced their Hue Connected Bulbs: an easy-to-use set of LED light bulbs and Wi-Fi connected bridge which allows you to dynamically change the color of your home lighting using their iOS or Android app. What’s particularly cool is that the bridge has a web API which you can access to set the colors of each bulb with your own app. We at untitled network developed our own Philips Hue app called Oni: light Control, which is&amp;nbsp;currently available on the Windows Phone Store. In addition to allowing you to set the color of your home lighting with defined “Moods”, the app also allows you to do the same using your phone’s built in voice commands or inexpensive NFC stickers. Here’s a demo of the Oni: Light Control in action:   I’m going to show you how you can develop your own app using the color picker from the Coding4Fun Toolkit for Windows Phone and the Json.Net library from Newtonsoft. These libraries can be found on NuGet, but you’ll obviously need the Philips Hue Connected Bulbs kit to test things out. Getting Started: The Philips Hue API uses a restful JSON interface you can access using any http client. Documentation on all of the supported methods by the Philips Hue bridge can be found at http://blog.ef.net/2012/11/02/philips-hue-api.html. To get started, you’ll need authorized access to your bridge’s API. Once the bridge has successfully established a network connection with your router, discover its internal IP address via the URL: http://www.meethue.com/api/nupnp You should get a response similar to: [{&amp;quot;id&amp;quot;:&amp;quot;ffss00fffe123456&amp;quot;,&amp;quot;internalipaddress&amp;quot;:&amp;quot;192.168.1.100&amp;quot;,&amp;quot;macaddress&amp;quot;:&amp;quot;0aa:bb:cc:dd:00:11&amp;quot;}]
 Note the internalipaddress value and use the IP to access the bridge’s API directly the with the URL http://192.168.1.100/api Now, since we haven’t registered a user for authorization, attempting to access the hub will return an error from the bridge: 
[{&amp;quot;error&amp;quot;:{&amp;quot;type</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/Philips-Hue-Lighting-Controller</link>
      <pubDate>Mon, 08 Apr 2013 15:17:51 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Philips-Hue-Lighting-Controller</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/93227cad-f0ec-4cb0-90b2-576862b90f5e.JPG" height="100" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/9407e40d-9ebd-479e-ace3-78d19024604d.jpg" height="124" width="220"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/b8395754-2668-4cc8-9b04-06434dd68dbb.jpg" height="288" width="512"></media:thumbnail>      
      <dc:creator>Clint Rutkas, Jarem Archer</dc:creator>
      <itunes:author>Clint Rutkas, Jarem Archer</itunes:author>
      <slash:comments>13</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/Philips-Hue-Lighting-Controller/RSS</wfw:commentRss>
      <category>C#</category>
      <category>Hardware</category>
      <category>Windows Phone</category>
    </item>
  <item>
      <title>Your house, 11 Netduinos and the Cloud...</title>
      <description><![CDATA[<p>Today's Hardware Friday project by Mike Linnen is one that's pretty awesome in a cool Internet of Things kind of way. We've featured bits and pieces of like functionality in the past, but I don't think something ever as complete as this.</p><p>The best part of all is that it's not really a project as much as it is a &quot;teach you to fish all the while creating an awesome thing&quot; kind of... well... thing.</p><h2><a href="http://www.protosystem.net/post/2013/02/14/Demo-connecting-11-Netduinos-to-Windows-Azure-Service.aspx">Demo connecting 11 Netduinos to Windows Azure Service</a></h2><blockquote><p>I put together a talk that includes a lab on building a security/home automation system using 11 netduinos communicating over MQTT with a broker located in Windows Azure.&nbsp; The attendees of this talk will walk through the lab and build out various components of a security system.</p><p>Here is a video demonstrating the various components of the system.&nbsp;&nbsp;</p><p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/PgB4qjhS3Ls&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/PgB4qjhS3Ls&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p><p>...</p></blockquote><h2><a href="http://www.cloudhomesecurity.com/" target="_blank">My Security</a></h2><blockquote><h4><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B2%5D-123.png" alt="image" width="485" height="364" border="0"></h4><h4>Overview</h4><p>This project was created to show off some fun things you can do to get started in the Internet of Things craze. This project was never intended to be an actual working Home Security system so don’t try and use it for that unless you really think about addressing some of the internet security issues that need to be tackled with a project like this. Please use this code as an example only!</p><p>Each device that is connected to the system's central hub will perform a specific function in the security platform. In a real security system you wouldn’t have mission critical devices dependent on external connectivity to the cloud. The connectivity to such an external system could be easily disrupted. Again this is just a fun example to get you thinking about connecting many devices to a cloud service.</p><p>The hardware used for this project is the <a href="http://www.netduino.com/netduinoplus2/specs.htm">Netduino Plus 2</a> from <a href="http://secretlabs.com/">Secret Labs LLC</a>. All code samples you see on this sight will target the Netduino Plus 2 device. However, the protocol to communicate with the cloud service is not platform specific so any device can be used to communicate with the Home Security service. So feel free to use a different .Net Micro Framework device. You could even use one of the very popular Arduino devices.</p><p>Of course the cloud service part of this project is running on the <a href="http://www.windowsazure.com/en-us/">Windows Azure Platform</a>. There are so many options available to you with the Azure platform. I decided to use a small subset of the features available just to prove that it doesn't take a lot to get something going on the Azure platform.</p><h4>Where to start</h4><p>As a participant in this project you will be building the devices that complete the Home Security system. Some basic code will already be written for you but for the most part it will be your job to complete the code and make the device functional. The cloud service that connects the devices is already completed and deployed to Windows Azure for you to use, so you wont need to do any of that coding. However the code for the cloud service is available in source control for you to look at.</p><ul><li><a href="http://www.cloudhomesecurity.com/Docs">Documentation</a> - This is where you will spend most of your time because it contains all the documentation to complete the lab exercises. </li><li><a href="http://www.cloudhomesecurity.com/Docs/GettingReadyForTheMeeting">Getting Ready For the Meeting</a> - All the information you need to come prepared for the event. </li><li><a href="https://github.com/mlinnen/CloudHomeSecurity">Azure Source Code Repository</a> - All the source for the Azure components of the security system. </li><li><a href="https://github.com/mlinnen/NetduinoHomeSecurity">Netduino Source Code Repository</a> - All the source for the Netduino components of the security system </li><li><a href="http://www.cloudhomesecurity.com/HomeSecurity">Dashboard</a> - This is the Home Security Dashboard where you can see the status of a device and interact with it </li><li><a href="http://www.slideshare.net/mlinnen/hacknight-powerpoint-16458192">Slide Deck</a> - The slides for the presentation </li></ul></blockquote><h3><a href="http://www.cloudhomesecurity.com/Docs">Documentation</a></h3><blockquote><h4>What do I need</h4><p>Before you attend this event you need to get a few things in order. We don't have a lot of time during the event to spend it setting up your development environment so make sure you check out <a href="http://www.cloudhomesecurity.com/Docs/GettingReadyForTheMeeting">Getting Ready For the Meeting</a>.</p><h4>What will I be doing</h4><p>You will be building one of the following devices in the home security system:</p><ul><li><a href="http://www.cloudhomesecurity.com/Docs/ExternalDoorEntry">External Door Entry</a>- This device handles all the I/O for any External Door </li><li><a href="http://www.cloudhomesecurity.com/Docs/DoorBell">Door Bell</a>- This device handles the I/O for letting the user know a door bell was pushed </li><li><a href="http://www.cloudhomesecurity.com/Docs/Alarm">Alarm</a>- This device handles the I/O for letting the user know the alarm was tripped </li><li><a href="http://www.cloudhomesecurity.com/Docs/AlarmControlPanel">Alarm Control Panel</a>- This device handles the I/O for the control panels placed in each room of the house </li><li><a href="http://www.cloudhomesecurity.com/Docs/MasterControlPanel">Master Control Panel</a>- This isn't really a device (but it could be) and it is already built for you. I am calling it out here because without it the entire system would be a bunch of devices that are independent of one another with no real central control managing the whole security system logic. </li></ul><p>Determine which one of the devices that you want to attempt to build. Some of the devices are harder to complete than others. If you want to start out easy then you can do the doorbell device. If you want a tougher challenge then go ahead and try the Alarm Control Panel.</p><p>There will be some code that is already written for you so that you don't have to worry about the communication protocols needed to publish and subscribe to the <a href="http://mqtt.org/">MQTT</a> message bus. Since the protocol is abstracted away from you all you need to know is that the MQTT messages are basically made up of two parts: a Topic and a Message. There is a lot more to the MQTT standard that you can read up on your own but you won't need it for this project. Basically, topics are a series of words separated by a / topic separator. The message is simply any string. The devices on the bus are expected to understand the topics and message formats, but like all pub/sub designs the devices don't know</p><p>...</p><h4>What is running in the cloud</h4><p>There are two main components that already exist in Azure that the devices will interact with: MQTT Message Broker and Master Control Panel. The message broker runs under an Azure Worker Role. The Master Control Panel runs in Windows Azure Web Role. The broker simply routes MQTT messages and has no real home security specific business logic on it. The Master Control Panel manages the state of the security system as well as the business rules around how the security system functions as a whole. SignalR is used to update the client browsers when the state of the security system changes. Take a look at the <a href="http://www.cloudhomesecurity.com/Docs/MasterControlPanel">Master Control Panel</a> for more details on how it functions.</p><p>...</p><p><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B8%5D-60.png" alt="image" width="473" height="364" border="0"></p></blockquote><p>As you can see, pretty awesome. If you're in his area, make sure you see him, and build this project with him... Scroll to the bottom of <a title="http://www.cloudhomesecurity.com/" href="http://www.cloudhomesecurity.com/">http://www.cloudhomesecurity.com/</a> to see where and when.</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:b42f0b5314984c169d13a1840123d601">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/Your-house-11-Netduinos-and-the-Cloud</comments>
      <itunes:summary>Today&#39;s Hardware Friday project by Mike Linnen is one that&#39;s pretty awesome in a cool Internet of Things kind of way. We&#39;ve featured bits and pieces of like functionality in the past, but I don&#39;t think something ever as complete as this. The best part of all is that it&#39;s not really a project as much as it is a &amp;quot;teach you to fish all the while creating an awesome thing&amp;quot; kind of... well... thing. Demo connecting 11 Netduinos to Windows Azure ServiceI put together a talk that includes a lab on building a security/home automation system using 11 netduinos communicating over MQTT with a broker located in Windows Azure.&amp;nbsp; The attendees of this talk will walk through the lab and build out various components of a security system. Here is a video demonstrating the various components of the system.&amp;nbsp;&amp;nbsp;  ... My SecurityOverviewThis project was created to show off some fun things you can do to get started in the Internet of Things craze. This project was never intended to be an actual working Home Security system so don’t try and use it for that unless you really think about addressing some of the internet security issues that need to be tackled with a project like this. Please use this code as an example only! Each device that is connected to the system&#39;s central hub will perform a specific function in the security platform. In a real security system you wouldn’t have mission critical devices dependent on external connectivity to the cloud. The connectivity to such an external system could be easily disrupted. Again this is just a fun example to get you thinking about connecting many devices to a cloud service. The hardware used for this project is the Netduino Plus 2 from Secret Labs LLC. All code samples you see on this sight will target the Netduino Plus 2 device. However, the protocol to communicate with the cloud service is not platform specific so any device can be used to communicate with the Home Security service. So feel free to use a different .</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/Your-house-11-Netduinos-and-the-Cloud</link>
      <pubDate>Fri, 22 Mar 2013 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/Your-house-11-Netduinos-and-the-Cloud</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/18e4e76c-934a-4837-9c28-3302cc417a10.png" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/3b89082e-08ae-4fc7-ad18-af18be2eef7b.png" height="165" width="220"></media:thumbnail>      
      <dc:creator>Greg Duncan</dc:creator>
      <itunes:author>Greg Duncan</itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/Your-house-11-Netduinos-and-the-Cloud/RSS</wfw:commentRss>
      <category>.NET Micro Framework</category>
      <category>Coding4Fun</category>
      <category>Hardware</category>
    </item>
  <item>
      <title>An amazing maze, with some Windows Phone 8, Netduino, servos and some 3D printing for flavor...</title>
      <description><![CDATA[<p>Welcome to the RogueCode Blog!</p><p>Just kidding... <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /> but with all the cool work Matt, aka RogueCode, has been doing, and which we've been highlighting, it kinds of feels that way doesn't it? Now if only the stuff he was doing wasn't just so darn cool.</p><p>We have just about everything in this project. Hardware, electronics, development, mobile even 3D printing!</p><h2><a href="http://blog.roguecode.co.za/Post/Netduino%2bWP8real-lifemazegame">Netduino &#43; WP8 real-life maze game</a></h2><blockquote><p>When I was young my parents bought me a wooden maze game. I loved that thing. I don’t think I ever cared much for the actual maze element – but the mechanism to tilt the stage was intriguing, and very simple.</p><p>When I remembered it the other day I managed to both find it online, and actually find my original one in an old cupboard from storage.</p><p><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B2%5D-120.png" alt="image" width="400" height="312" border="0"></p><p>Moving on a decade or two, we now have hundreds of these ball games on smartphones using their accelerometers (<a href="http://www.windowsphone.com/en-us/store/app/pocket-maze-free/3af75353-ec66-4b39-92b8-72b70e25a7d2">like this one</a> – a random one from the WP store), but their graphics leave a lot to be desired. Which is why I’ve made a photorealistic one <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-5.gif?v=c9' alt='Wink' /></p><p><strong>The objective</strong> was to make a maze game that was a merge between the old-school and new-school ones. So the phone is used as a tilt controller to control the physical maze via Bluetooth with a Netduino. The maze is a simple model printed on my 3D printer and is tilted by using two servos. Bonus points for adding a switch mechanism to report back to the phone when the player gets to the end.</p><h3><strong>What you need</strong>:</h3><ul><li>2 fairly strong servos. I used Turnigy metal-gear ones from <a href="http://www.hobbyking.com/hobbyking/store/__17322__Turnigy_TGY_9018MG_Metal_Gear_Servo_2_5kg_13g_0_10.html">HobbyKing</a>. </li><li>Bluetooth module </li><li>Netduino </li><li>Small square maze-like object </li><li>10K ohm resistor </li><li>4.8V battery pack </li><li>Conductive ball-bearing/marble </li></ul></blockquote><p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/q_nzCgNW28g&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/q_nzCgNW28g&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p><p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/XBzHrL2hT5c&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/XBzHrL2hT5c&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p><blockquote><h3>The maze:</h3><p>This probably took longer than all the other parts combined because my 3D printer’s extruder nozzle jammed up rather solidly. And even when I did eventually get it to print, the result was pretty terrible. However, the actual maze model at the end of this post is perfect and will print fine on your printer if you have one. I printed it 9CM x 9CM because that is about the biggest my Makerbot Thing-O-Matic can print.</p><p><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B8%5D-59.png" alt="image" width="500" height="214" border="0"></p><p>To make the model, I first went to <a href="http://www.mazegenerator.net/">http://www.mazegenerator.net/</a> and generated a 9X9 maze. Then imported the result into SketchUp, traced out the lines, and extruded the walls up. I only made the walls high enough to steer the ball – not encase it.</p></blockquote><p>And of course, Matt's made everything that can be downloaded, downloadable...</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:17b87517f5f64c75970ba17d011ef2d6">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/An-amazing-maze-with-some-Windows-Phone-8-Netduino-servos-and-some-3D-printing-for-flavor</comments>
      <itunes:summary>Welcome to the RogueCode Blog! Just kidding...  but with all the cool work Matt, aka RogueCode, has been doing, and which we&#39;ve been highlighting, it kinds of feels that way doesn&#39;t it? Now if only the stuff he was doing wasn&#39;t just so darn cool. We have just about everything in this project. Hardware, electronics, development, mobile even 3D printing! Netduino &amp;#43; WP8 real-life maze gameWhen I was young my parents bought me a wooden maze game. I loved that thing. I don’t think I ever cared much for the actual maze element – but the mechanism to tilt the stage was intriguing, and very simple. When I remembered it the other day I managed to both find it online, and actually find my original one in an old cupboard from storage.  Moving on a decade or two, we now have hundreds of these ball games on smartphones using their accelerometers (like this one – a random one from the WP store), but their graphics leave a lot to be desired. Which is why I’ve made a photorealistic one  The objective was to make a maze game that was a merge between the old-school and new-school ones. So the phone is used as a tilt controller to control the physical maze via Bluetooth with a Netduino. The maze is a simple model printed on my 3D printer and is tilted by using two servos. Bonus points for adding a switch mechanism to report back to the phone when the player gets to the end. What you need:2 fairly strong servos. I used Turnigy metal-gear ones from HobbyKing. Bluetooth module Netduino Small square maze-like object 10K ohm resistor 4.8V battery pack Conductive ball-bearing/marble   The maze:This probably took longer than all the other parts combined because my 3D printer’s extruder nozzle jammed up rather solidly. And even when I did eventually get it to print, the result was pretty terrible. However, the actual maze model at the end of this post is perfect and will print fine on your printer if you have one. I printed it 9CM x 9CM because that is about the biggest my Makerbot Thing-</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/An-amazing-maze-with-some-Windows-Phone-8-Netduino-servos-and-some-3D-printing-for-flavor</link>
      <pubDate>Fri, 15 Mar 2013 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/An-amazing-maze-with-some-Windows-Phone-8-Netduino-servos-and-some-3D-printing-for-flavor</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/7a5d856a-3ebb-4a20-a495-1b800d185f5b.png" height="45" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/567de521-4ca9-4978-a9e7-88539c74b41f.png" height="100" width="220"></media:thumbnail>      
      <dc:creator>Greg Duncan</dc:creator>
      <itunes:author>Greg Duncan</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/An-amazing-maze-with-some-Windows-Phone-8-Netduino-servos-and-some-3D-printing-for-flavor/RSS</wfw:commentRss>
      <category>.NET Micro Framework</category>
      <category>Bluetooth</category>
      <category>Coding4Fun</category>
      <category>Hardware</category>
    </item>
  <item>
      <title>Flying the AR.Drone 2.0 with Windows Store Applications</title>
      <description><![CDATA[<h4>The AR.Drone 2.0</h4><p>The Parrot AR.Drone 2.0 is an awesome device packed with cool features. The drone contains two cameras, one pointed forward that streams live video, and one pointed downwards (for all your surveillance needs). Its got four powerful engines that make it fast and maneuverable. The drone’s firmware keeps it stable and level while stationary or performing maneuvers, handling a huge burden for the user. It’s a fun device to write code for, and even more fun to pilot when you’re done!</p><p>There’s a few projects that have created AR.Drone APIs that can be used for Windows 8 Desktop Apps. However, I wanted to fly my drone from a Windows Store App, so I decided to build my own API compatible with WinRT. The result is covered in this series of posts. Thanks to Nisha Singh (<a title="http://blogs.msdn.com/b/nishasingh/" href="http://blogs.msdn.com/b/nishasingh/">http://blogs.msdn.com/b/nishasingh/</a>) and everyone else who helped me out with this project!</p><p>In the first post, I’ll go over how the API handles communicating with and controlling the drone, and then demonstrate how to use the API to make a simple control App.</p><p>&nbsp;</p><h4>API Information and Terms</h4><p>The API consists of 5 files:</p><ul><li>DroneConnection.cs: functionality to connect to, and disconnect from, the drone. </li><li>DroneControl.cs: contains the control loop. </li><li>DroneMovement.cs: contains methods that construct and return fully-formatted commands. </li><li>InputProcessing.cs: determines the next command to issue to the drone. </li><li>InputState.cs: used to pass information between the UI and back-end. </li><li><p>The terms the API code uses to refer to axes of movement are as follows:</p></li><li>DroneStrafeX: left-right. </li><li>DroneStrafeY: forward-backward. </li><li>DroneRotateX: yaw, or rotation. </li><li>DroneAscendY: up-down. </li><li><p>&nbsp;</p><h4>Communicating with the Drone</h4><p>The AR.Drone 2.0 communicates with other devices through its own wireless network. Sending the drone instructions is as simple as connecting your computer to the drone’s network, opening a UDP connection to the drone (I.P. 192.168.1.1, Port 5556), and then sending commands over this connection. The code to connect to the drone is contained inside DroneConnection.cs:</p><pre class="brush: csharp">
// Initialize the connection to the drone
public static async Task ConnectToDrone()
{
      
         ...
      
         // Set up the UDP connection
         string remotePort = &quot;5556&quot;;
         HostName droneIP = new HostName(&quot;192.168.1.1&quot;);
      
         udpSocket = new DatagramSocket();
         await udpSocket.BindServiceNameAsync(remotePort);
         await udpSocket.ConnectAsync(droneIP, remotePort);
         udpWriter = new DataWriter(udpSocket.OutputStream);
      
         ...
      
}
</pre> <div id="codeSnippetWrapper">&nbsp;</div><p>Once a connection has been established, we can begin to send the drone messages:</p><p><pre class="brush: csharp">
// Send a command to the drone
public static async Task SendDroneCommand(string command)
{
         udpWriter.WriteString(command);
         await udpWriter.StoreAsync();
}
</pre></p><p>This networking code is discussed more in-depth here: <a title="http://blogs.msdn.com/b/trycatchfinally/archive/2012/09/06/welcome.aspx" href="http://blogs.msdn.com/b/trycatchfinally/archive/2012/09/06/welcome.aspx">Try, Catch, Finally... - UDP and Windows 8 Apps</a></p><p>The drone needs to continuously receive commands for it to remain responsive. If the drone doesn’t receive any commands for two seconds, it assumes the connection has been lost, and it will ignore any further commands. If this happens, you need to close and re-establish the connection before you can continue to pilot the drone. DroneConnection.cs contains methods that allow you to do this.</p><p>&nbsp;</p><h4>Commanding the Drone</h4><p>You can command the drone by sending it strings called AT commands. There are seven different categories of AT commands, but only two are required to fly the drone, and are the only ones included in the API:</p></li><li>AT*REF – Used for basic behavior such as takeoff/landing, and emergency stop/reset. </li><li>AT*PCMD – Used to fly the drone once airborne. This controls pitch, yaw, roll, and altitude. </li><li><p>AT commands have very specific formatting, and consist of four parts. An improperly formatted command will be ignored by the drone. The different sections of an AT*PCMD command are highlighted below:</p><p>&nbsp;</p><p>AT*PCMD=23,1,0,0,0,0\r\n</p><p>&nbsp;</p><p>Header: The type of the AT command</p><p>Sequence Number: The sequence number is used by the drone to keep track of which commands it needs to execute. The drone will not execute any commands with a sequence number lower than the highest sequence number it has received so far. The first command sent should always have a sequence number of 1, and each command sent subsequently should increment this number by 1. The sequence number can be manually reset by sending a command with the number 1.</p><p>Payload: This carries the command arguments. Its format and content vary from command to command. In the AT*PCMD command, the first value is a flag indicating whether the drone should do nothing (low) or move according to the other arguments (high). The next four values denote roll, pitch, vertical speed, and angular speed respectively. These values are floats ranging from [-1, 1], where (0, 1] represents movement speed in one direction, and [-1, 0) represents the other. A 0 causes the drone to remain stationary along that axis, a 1 or –1 is maximum movement speed in their respective directions, and each value between is a fraction of the maximum possible speed. For example, in the pitch argument, a .75 would cause the drone to move backward at 3/4 maximum speed, while a –.5 would make it move forward at 1/2 the possible speed. However, the drone doesn’t respond to values in the [-1, 1] range. The actual value that needs to be inserted into the AT command is the signed integer value represented by the bytes the float is actually stored in. This conversion is done for you in the FloatConversion method in DroneMovement.cs.</p><p>Carriage Character: A newline character. Use the one specific to your environment.</p><p>DroneMovement.cs has a set of methods to generate AT*REF and AT*PCMD commands, all of which take the current sequence number as an argument, and return a ready-to-send AT command. Some methods take additional arguments to control the movement speed. An example of one of these methods is:</p><pre class="brush: csharp">
// Strafe drone forward or backward at velocity in range [-1,1]
public static string GetDroneStrafeForwardBackward(uint sequenceNumber, double velocity)
{
         // Convert the ratio into a value the drone understands
         int value = FloatConversion(velocity);
         return CreateATPCMDCommand(sequenceNumber, &quot;0,&quot; &#43; value &#43; &quot;,0,0&quot;); 
}
  
// Return a full ATPCMD command
private static string CreateATPCMDCommand(uint sequenceNumber, string command)
{
         return &quot;AT*PCMD=&quot; &#43; sequenceNumber &#43; &quot;,1,&quot; &#43; command &#43; Environment.NewLine;
}
</pre> <p><strong>Control Infrastructure</strong></p><p>The drone is controlled with an continuous loop that sends a command to the drone every 30 ms. Each cycle, the loop determines the next command, sends the command to the drone, and then increments the sequence number. The method is asynchronous and awaits the call to System.Threading.Tasks.Task.Delay() so that it doesn’t block the UI between cycles.</p><p><pre class="brush: csharp">
public static async void ControlLoop()
{
         while (true)
         {
          
                 ...
          
                 // Get and send the next command
                 string commandToSend = InputProcessing.NextCommand(sequenceNumber);
                 await DroneConnection.SendDroneCommand(commandToSend);
          
                 sequenceNumber&#43;&#43;;
          
                 await System.Threading.Tasks.Task.Delay(30);
         }
}
</pre></p><p>You need to implement the InputProcessing.NextCommand() method to return an AT command based on criteria of your own choosing. The API includes the class InputState.cs that you can use to pass information between your UI and the control infrastructure. The example App contains an example of this.</p><h4>Example App</h4><p>I’ve included a simple example App to demonstrate how to use the API. The App allows you to connect to the drone and make it take off, land, and rotate. It also illustrates how to pass input information between the UI and the control infrastructure using InputState instances. In the App, FlyingPage contains the method GetState() that returns an instance of InputState. GetState() looks at the input the App is receiving, then creates and returns an instance of InputState containing that information.</p><pre class="brush: csharp">
// returns the current state of the input controls
public static InputState GetState()
{
         // slider value is in the range [-1,1]
         return new InputState(0, 0, 0, sliderValue, isFlying);
}
</pre> <p>InputProcessing.NextCommand() calls GetState, and then interprets the state to decide on the next command to send:</p><pre class="brush: csharp">
// returns the next command that should be executed
public static string NextCommand(uint sequenceNumber)
{
         InputState state = MainPage.GetState();
      
         // Determine if the drone needs to take off or land
         if (state.startFlying &amp;&amp; !isFlying)
         {
                 isFlying = !isFlying;
                 return DroneMovement.GetDroneTakeoff(sequenceNumber);
         }
         else if (!state.startFlying &amp;&amp; isFlying)
         {
                 isFlying = !isFlying;
                 return DroneMovement.GetDroneLand(sequenceNumber);
         }
      
         
         // Check if the drone needs to rotate
         if (state.rotateX != 0)
         {
                 return DroneMovement.GetDroneRotate(sequenceNumber, state.rotateX);
         }
      
         // Otherwise have the drone do nothing.
         return DroneMovement.NullCommand(sequenceNumber);
}
</pre> <p>The command decision is made in order of importance. Takeoff and landing commands are the most important, followed by movement commands. If there is no other command to send, NextCommand() returns a null command so that the drone will continue hovering and listening to the connection.</p><p>Once NextCommand() has been implemented, all the App needs to do is connect to the drone and initiate the control loop by calling DroneConnection.ConnectToDrone(), followed by calling DroneControl.ControlLoop(). In the example App, this is done in the handler for the connect button. Once the control loop is running, the drone is ready to fly!</p><h4>Get Flying</h4><p>The API should give you everything you need to get started writing drone Apps for Windows Store. In part 2, I’ll discuss a more complete App I’ve written to pilot the drone. There’s still so much drone functionality to be exposed, so get coding and get flying!</p></li></ul> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:47d1ec89174242a29500a10b0130e4bf">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Flying-the-ARDrone-20-with-Windows-Store-Applications</comments>
      <itunes:summary>The AR.Drone 2.0The Parrot AR.Drone 2.0 is an awesome device packed with cool features. The drone contains two cameras, one pointed forward that streams live video, and one pointed downwards (for all your surveillance needs). Its got four powerful engines that make it fast and maneuverable. The drone’s firmware keeps it stable and level while stationary or performing maneuvers, handling a huge burden for the user. It’s a fun device to write code for, and even more fun to pilot when you’re done! There’s a few projects that have created AR.Drone APIs that can be used for Windows 8 Desktop Apps. However, I wanted to fly my drone from a Windows Store App, so I decided to build my own API compatible with WinRT. The result is covered in this series of posts. Thanks to Nisha Singh (http://blogs.msdn.com/b/nishasingh/) and everyone else who helped me out with this project! In the first post, I’ll go over how the API handles communicating with and controlling the drone, and then demonstrate how to use the API to make a simple control App. &amp;nbsp; API Information and TermsThe API consists of 5 files: DroneConnection.cs: functionality to connect to, and disconnect from, the drone. DroneControl.cs: contains the control loop. DroneMovement.cs: contains methods that construct and return fully-formatted commands. InputProcessing.cs: determines the next command to issue to the drone. InputState.cs: used to pass information between the UI and back-end. The terms the API code uses to refer to axes of movement are as follows: DroneStrafeX: left-right. DroneStrafeY: forward-backward. DroneRotateX: yaw, or rotation. DroneAscendY: up-down. &amp;nbsp; Communicating with the DroneThe AR.Drone 2.0 communicates with other devices through its own wireless network. Sending the drone instructions is as simple as connecting your computer to the drone’s network, opening a UDP connection to the drone (I.P. 192.168.1.1, Port 5556), and then sending commands over this connection. The code to connect to t</itunes:summary>
      <itunes:duration>38</itunes:duration>
      <link>http://channel9.msdn.com/coding4fun/articles/Flying-the-ARDrone-20-with-Windows-Store-Applications</link>
      <pubDate>Wed, 30 Jan 2013 20:44:13 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Flying-the-ARDrone-20-with-Windows-Store-Applications</guid>
      <media:thumbnail url="http://media.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone_100.jpg" height="56" width="100"></media:thumbnail>
      <media:thumbnail url="http://media.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone_220.jpg" height="123" width="220"></media:thumbnail>
      <media:thumbnail url="http://media.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone_512.jpg" height="288" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://media.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone.mp3" expression="full" duration="38" fileSize="613368" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://media.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone.mp4" expression="full" duration="38" fileSize="3549735" type="video/mp4" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone.webm" expression="full" duration="38" fileSize="1414464" type="video/webm" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone.wma" expression="full" duration="38" fileSize="317447" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://media.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone.wmv" expression="full" duration="38" fileSize="2360171" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone_high.mp4" expression="full" duration="38" fileSize="7740622" type="video/mp4" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone_mid.mp4" expression="full" duration="38" fileSize="5386511" type="video/mp4" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone_Source.wmv" expression="full" duration="38" fileSize="13005298" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://smooth.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone.ism/manifest" expression="full" duration="38" fileSize="7674" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://media.ch9.ms/ch9/106e/0b67c1ce-dbb3-40f2-8595-a22760b0106e/20121116arDrone.wmv" length="2360171" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Clint Rutkas, Peter Dwersteg</dc:creator>
      <itunes:author>Clint Rutkas, Peter Dwersteg</itunes:author>
      <slash:comments>3</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/Flying-the-ARDrone-20-with-Windows-Store-Applications/RSS</wfw:commentRss>
      <category>C#</category>
      <category>Hardware</category>
      <category>Windows Store App</category>
    </item>
  <item>
      <title>2 plus awesome = The just released netduino plus 2!</title>
      <description><![CDATA[<p>What can't we get enough of here? What's one of our favorite hardware platforms? What is the latest and shiniest new release? A release that JUST happened yesterday?</p><p>Here's a hint from Chris Walker...</p><blockquote><p><u>Summary</u></p><p>2x the RAM, 4x the speed, and 6x the flash of GEN1 <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' />&nbsp; Many users have run out of flash/RAM on gen1, so the huge upgrade is going to be pretty big news.</p><p><u>Most Vital Specs</u></p><ul><li>168 MHz </li><li>384KB code space (1MB total flash) </li><li>100KB&#43; available RAM (192KB total RAM) </li></ul><p><u>New Features</u></p><ul><li>OneWire support </li><li>Four serial ports (vs. 2 serial ports on gen1) </li><li>Compatibility with even more Arduino shields <ul><li>Higher current </li><li>All six core PWMs </li><li>Compatible with new extended Arduino shield form factor </li></ul></li><li>MiniJTAG – for debugging of native code (side-by-side with C#/VB debugging via USB) </li></ul></blockquote><p>Figured it out yet?</p><h2><a href="http://www.netduino.com/netduinoplus2/specs.htm" target="_blank">netduino plus 2</a></h2><blockquote><p><a href="http://www.netduino.com/netduinoplus2/specs.htm" target="_blank"><img title="SNAGHTMLef6a0de" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/SNAGHTMLef6a0de%5B4%5D.png" alt="SNAGHTMLef6a0de" width="500" height="325" border="0"></a></p><p><strong>system requirements</strong></p><p><strong><img src="http://www.netduino.com/images/tpixel.gif" alt="" width="1" height="15"></strong>Windows</p><ul><li><img src="http://www.netduino.com/images/tpixel.gif" alt="" width="1" height="5">Windows XP, Vista, or 7 (32 or 64 bit)<br>Recommended: Windows 7 or 8 </li><li>1.6 GHz or faster processor </li><li>1 GB RAM </li><li>Up to 3 GB of available hard drive space for Visual Studio Express 2010 </li></ul><p><strong>design files and source code</strong></p><p><strong><img src="http://www.netduino.com/images/tpixel.gif" alt="" width="1" height="15"></strong>design files (open source)</p><ul><li><img src="http://www.netduino.com/images/tpixel.gif" alt="" width="1" height="5"><a href="http://www.netduino.com/netduinoplus2/schematic.pdf">netduino plus 2 schematics</a> </li><li><a href="http://www.netduino.com/downloads/netduinoplus2/netduinoplus2layout.zip">netduino plus 2 board layout</a> </li></ul><p><img src="http://www.netduino.com/images/tpixel.gif" alt="" width="1" height="15">source code (open source)</p><ul><li><img src="http://www.netduino.com/images/tpixel.gif" alt="" width="1" height="5"><a href="http://netmf.codeplex.com/releases/view/82448#DownloadId=343357">.NET Micro Framework v4.2 source</a> </li><li>netduino firmware v4.2.1 source<br>coming soon </li><li>netduino sdk v4.2.1 source<br>coming soon </li></ul></blockquote><p><a href="http://www.netduino.com/netduinoplus2/specs.htm" target="_blank"><img title="np2_clint_angle" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/np2_clint_angle%5B3%5D.jpg" alt="np2_clint_angle" width="414" height="364" border="0"></a><a href="http://www.netduino.com/netduinoplus2/specs.htm" target="_blank"><img title="np2_clint_overhead" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/np2_clint_overhead%5B3%5D.jpg" alt="np2_clint_overhead" width="364" height="364" border="0"></a></p><p>Also remember if you want something a bit easier, try the Netduino Go! Or the Gadgeteer boards over at GHI. We love all our hardware vendors providing .Net Microsoft Framework compatible systems. There's hardware for every skill level (even one for a dev like me!... cough... Gadgeteer... cough...&nbsp; Now that's saying something)</p><p>Remember when you build something awesome with one of these systems, drop us a line. Thanks and most importantly, have fun!</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:bfdeb30f26bb4e658977a1040020a43d">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/2-plus-awesome--The-just-released-netduino-plus-2</comments>
      <itunes:summary>What can&#39;t we get enough of here? What&#39;s one of our favorite hardware platforms? What is the latest and shiniest new release? A release that JUST happened yesterday? Here&#39;s a hint from Chris Walker... Summary 2x the RAM, 4x the speed, and 6x the flash of GEN1 &amp;nbsp; Many users have run out of flash/RAM on gen1, so the huge upgrade is going to be pretty big news. Most Vital Specs 168 MHz 384KB code space (1MB total flash) 100KB&amp;#43; available RAM (192KB total RAM) New Features OneWire support Four serial ports (vs. 2 serial ports on gen1) Compatibility with even more Arduino shields Higher current All six core PWMs Compatible with new extended Arduino shield form factor MiniJTAG – for debugging of native code (side-by-side with C#/VB debugging via USB) Figured it out yet? netduino plus 2 system requirements Windows Windows XP, Vista, or 7 (32 or 64 bit)Recommended: Windows 7 or 8 1.6 GHz or faster processor 1 GB RAM Up to 3 GB of available hard drive space for Visual Studio Express 2010 design files and source code design files (open source) netduino plus 2 schematics netduino plus 2 board layout source code (open source) .NET Micro Framework v4.2 source netduino firmware v4.2.1 sourcecoming soon netduino sdk v4.2.1 sourcecoming soon  Also remember if you want something a bit easier, try the Netduino Go! Or the Gadgeteer boards over at GHI. We love all our hardware vendors providing .Net Microsoft Framework compatible systems. There&#39;s hardware for every skill level (even one for a dev like me!... cough... Gadgeteer... cough...&amp;nbsp; Now that&#39;s saying something) Remember when you build something awesome with one of these systems, drop us a line. Thanks and most importantly, have fun! </itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/2-plus-awesome--The-just-released-netduino-plus-2</link>
      <pubDate>Fri, 09 Nov 2012 14:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/2-plus-awesome--The-just-released-netduino-plus-2</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/7ee4ff79-347a-4625-b1bf-d06720fb5e09.jpg" height="88" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/93b1155a-d074-48c0-bc7b-98486206e468.jpg" height="194" width="220"></media:thumbnail>      
      <dc:creator>Greg Duncan</dc:creator>
      <itunes:author>Greg Duncan</itunes:author>
      <slash:comments>1</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/2-plus-awesome--The-just-released-netduino-plus-2/RSS</wfw:commentRss>
      <category>.NET Micro Framework</category>
      <category>Coding4Fun</category>
      <category>Hardware</category>
    </item>
  <item>
      <title>EdgeShow 42 Build summary for IT Pros</title>
      <description><![CDATA[<p>In this special Edge show episode, the team gives coverage of Build as it relates to IT professionals and recent announcements.&nbsp; More specifically, we cover:</p><ul type="disc"><li><a href="http://www.microsoft.com/en-us/news/Press/2012/Oct12/10-25Windows8GAPR.aspx"><span>Windows 8 GA launch</span></a> </li><li><span><a href="http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros#time=00m58s">[00:58]</a> Build </span><span>Pre-conference&nbsp;stats </span></li><li><span><a href="http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros#time=01m54s">[01:54]</a> </span><span>Day 1 keynote -&nbsp;Ballmer's demos Rick's Ballmer moments </span></li><li><span>Hardware </span><ul type="circle"><li><span><a href="http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros#time=03m27s">[03:27]</a> </span><span>Acer UX31A</span> </li><li><span>ASUS Zenbook Touch</span> </li><li><span><a href="http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros#time=05m08s">[05:08]</a> </span><span>Lenovo Yoga </span></li><li><span><a href="http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros#time=06m13s">[06:13]</a> </span><span>Surface RT &#43;&nbsp;Touch and Type Covers</span> </li><li><span><a href="http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros#time=08m15s">[08:15]</a> </span><span>Dell&nbsp;XPS&nbsp;all-in-one</span> </li></ul></li><li><span><a href="http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros#time=10m23s">[10:23]</a> </span><span>Day 2 keynote -&nbsp;Azure stuff relevant for IT Pros</span> </li><li><span><a href="http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros#time=12m43s">[12:43]</a> </span><span>Windows Phone 8 -&nbsp;Nokia 920 and Kid mode</span> </li><li><span><a href="http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros#time=14m55s">[14:55]</a> </span><span>Relevant BUILD&nbsp;sessions for IT Pros</span> <ul type="circle"><li><a href="http://channel9.msdn.com/Events/Build/2012/3-052"><span>Extending and customizing Dynamic Access Control</span></a> </li><li><a href="http://channel9.msdn.com/Events/Build/2012/2-025"><span>Delivering Apps with Remote FX&nbsp;in Windows Server 2012</span></a> </li><li><a href="http://channel9.msdn.com/Events/Build/2012/3-051"><span>Developing highly-available,&nbsp;scale-out applications for Windows Server 2012</span></a> </li><li><a href="http://channel9.msdn.com/Events/Build/2012/3-123"><span>Security in Windows Store&nbsp;Applications</span></a> </li></ul></li></ul><p><span><strong>Connect with the Edge Team:</strong></span></p><p><a href="https://www.facebook.com/group.php?gid=5850797374"><span>Facebook</span></a><span> – </span><a href="https://twitter.com/tnedge"><span>Twitter</span></a>&nbsp;- <a href="mailto:edge@microsoft.com">Email</a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:7449c848b82446b3bc93a100015e0c80">]]></description>
      <comments>http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros</comments>
      <itunes:summary>In this special Edge show episode, the team gives coverage of Build as it relates to IT professionals and recent announcements.&amp;nbsp; More specifically, we cover: Windows 8 GA launch [00:58] Build Pre-conference&amp;nbsp;stats [01:54] Day 1 keynote -&amp;nbsp;Ballmer&#39;s demos Rick&#39;s Ballmer moments Hardware [03:27] Acer UX31A ASUS Zenbook Touch [05:08] Lenovo Yoga [06:13] Surface RT &amp;#43;&amp;nbsp;Touch and Type Covers [08:15] Dell&amp;nbsp;XPS&amp;nbsp;all-in-one [10:23] Day 2 keynote -&amp;nbsp;Azure stuff relevant for IT Pros [12:43] Windows Phone 8 -&amp;nbsp;Nokia 920 and Kid mode [14:55] Relevant BUILD&amp;nbsp;sessions for IT Pros Extending and customizing Dynamic Access Control Delivering Apps with Remote FX&amp;nbsp;in Windows Server 2012 Developing highly-available,&amp;nbsp;scale-out applications for Windows Server 2012 Security in Windows Store&amp;nbsp;Applications Connect with the Edge Team: Facebook – Twitter&amp;nbsp;- Email </itunes:summary>
      <itunes:duration>1082</itunes:duration>
      <link>http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros</link>
      <pubDate>Tue, 06 Nov 2012 01:20:59 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros</guid>
      <media:thumbnail url="http://media.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap_100.jpg" height="56" width="100"></media:thumbnail>
      <media:thumbnail url="http://media.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap_220.jpg" height="123" width="220"></media:thumbnail>
      <media:thumbnail url="http://media.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap_512.jpg" height="288" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://media.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap.mp3" expression="full" duration="1082" fileSize="1" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://media.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap.mp4" expression="full" duration="1082" fileSize="1" type="video/mp4" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap.webm" expression="full" duration="1082" fileSize="1" type="video/webm" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap.wma" expression="full" duration="1082" fileSize="1" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://media.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap.wmv" expression="full" duration="1082" fileSize="1" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap_high.mp4" expression="full" duration="1082" fileSize="1" type="video/mp4" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap_mid.mp4" expression="full" duration="1082" fileSize="1" type="video/mp4" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap_Source.wmv" expression="full" duration="1082" fileSize="1" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://smooth.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap.ism/manifest" expression="full" duration="1082" fileSize="1" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://media.ch9.ms/ch9/2630/8bced08e-0e7a-4711-ab0d-e0ae1ec02630/EdgeShowBuildforITrecap.wmv" length="0" type="video/x-ms-wmv"></enclosure>
      <dc:creator>David Tesar, RicksterCDN, Joey Snow, Symon Perriman</dc:creator>
      <itunes:author>David Tesar, RicksterCDN, Joey Snow, Symon Perriman</itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Shows/Edge/EdgeShow-42-BUILD-summary-for-IT-Pros/RSS</wfw:commentRss>
      <category>Computer Hardware</category>
      <category>Hardware</category>
      <category>Microsoft Surface</category>
      <category>Surface</category>
      <category>Windows Phone</category>
      <category>Windows Server</category>
      <category>Build</category>
      <category>Windows 8</category>
    </item>
  <item>
      <title>Entering the [LED] Matrix with Netduino</title>
      <description><![CDATA[<p>Today Hardware Friday post from Mario Vernari is one that I thought a little different than others I've blogged about (though related), one that helps solve a difficult problem and can might be a good kick off for building some Holiday hardware displays too...</p><h2><a href="http://highfieldtales.wordpress.com/2012/10/06/led-matrix-controller-driven-via-spi/">Led-matrix controller driven via SPI</a></h2><blockquote><p>Time ago, Stanislav -a Netduino community user- posted a problem on how to drive a 6-by-4 led-matrix using its Netduino. After some experiment, he got stuck with the circuit, because a matrix must be multiplexed, and that’s not easy to solve.</p><p>Here is the <a href="http://forums.netduino.com/index.php?/topic/4191-led-matrix/">link</a> to the forum thread.</p><p>If you read the message exchange on the thread, then you’ll collect easily a list of constraints. Here they are:</p><ul><li>the leds have been already assembled (i.e. only the multiplex driver is needed) </li><li>the overall price should fall within 10 Euro </li><li>must be handcrafted, thus no use of small parts (e.g. SMDs) </li><li>the multiplex should not stop its cycling as the Netduino stops (avoid leds burnout) </li><li>the circuit should avoid complicate wiring, so that the PCB can get pretty easy </li><li>reliable enough </li><li>finally, Stanislav asked to learn how to design such a circuit </li></ul><p>It was clear that Netduino only wasn’t enough to drive a 6×4 led-matrix. First off, for the inability to give enough current for the leds, and secondly for the relative slowness of the managed code running into.</p><h5>The problem in depth.</h5><p>Light up a led is very simple. Starting from the power supply, as parameter you have the current flowing through the led, then calculating the resistor to put in series. A led needs from few mA (SMDs), to several hundreds of mA (or even more) for the high-power class.<br>Let’s face the multiplex problem thinking to a normal discrete-led which needs 10 mA for a normal brightness.</p><p><strong>So, what is a multiplex?</strong><br>The multiplexing is a technique for driving many loads (e.g. leds), using a relatively low number of wires. Thinking to a 6×4 led-matrix, instead having 24 wires (one for each led), the multiplex-way needs only 6&#43;4 = 10 wires at all. The trick is enabling one column at once, and issuing the related row pattern. If this process is fast enough, our eyes can’t perceive the scanning.</p><p>Now, let’s focus on a single column of four leds: the scan process cycles over, but each column is enabled only at 25% (i.e. 1/4) of the total cycle-time. It means that to yield the same brightness as the led was lit with 10 mA, <strong>we should raise it of a factor of 4, thus 40 mA</strong>. This current is off the upper limit achievable by a normal logic chip.</p><p>By the way 40 mA is probably above the led’s limit. However, the current is flowing only for a quarter of the cycle, so there’s no warm up in the *average*. We only should take care to *avoid* any cycle break, otherwise the 40 mA will flow for a too long time, and the led blows.</p><p>That’s not all. When a column is enabled, there are 6 leds composing it, and they might be all on (worst case). So, the total current flowing is 40 mA x 6 = 240 mA.<br>How much is the current of each row, instead? A row drives only the led at where the column is enabled, but at 25% duty, of course. It means the 40 mA seen above.</p><h5>My solution.</h5><p>To solve this problem, I see three ways:</p><p>...</p></blockquote><p><a href="http://highfieldtales.wordpress.com/2012/10/06/led-matrix-controller-driven-via-spi/" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B9%5D-26.png" alt="image" width="294" height="384" border="0"></a></p><p><a href="http://highfieldtales.wordpress.com/2012/10/06/led-matrix-controller-driven-via-spi/" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B10%5D-30.png" alt="image" width="475" height="384" border="0"></a></p><p><a href="http://highfieldtales.wordpress.com/2012/10/06/led-matrix-controller-driven-via-spi/" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B11%5D-39.png" alt="image" width="520" height="355" border="0"></a></p><p><a href="http://highfieldtales.wordpress.com/2012/10/06/led-matrix-controller-driven-via-spi/" target="_blank"><img title="SNAGHTML2af669" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/SNAGHTML2af669%5B5%5D.png" alt="SNAGHTML2af669" width="500" height="322" border="0"></a></p><p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/2VXWlNz32o8&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/2VXWlNz32o8&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p><p>I mentioned holidays? Well don't you see yourself coding something up to display some kind of holiday stuff with this? Come on, you know you want to code this to display some kind of little animated Christmas Tree... <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:7b33c5601965494f9757a0f10155a65a">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/Entering-the-LED-Matrix-with-Netduino</comments>
      <itunes:summary>Today Hardware Friday post from Mario Vernari is one that I thought a little different than others I&#39;ve blogged about (though related), one that helps solve a difficult problem and can might be a good kick off for building some Holiday hardware displays too... Led-matrix controller driven via SPITime ago, Stanislav -a Netduino community user- posted a problem on how to drive a 6-by-4 led-matrix using its Netduino. After some experiment, he got stuck with the circuit, because a matrix must be multiplexed, and that’s not easy to solve. Here is the link to the forum thread. If you read the message exchange on the thread, then you’ll collect easily a list of constraints. Here they are: the leds have been already assembled (i.e. only the multiplex driver is needed) the overall price should fall within 10 Euro must be handcrafted, thus no use of small parts (e.g. SMDs) the multiplex should not stop its cycling as the Netduino stops (avoid leds burnout) the circuit should avoid complicate wiring, so that the PCB can get pretty easy reliable enough finally, Stanislav asked to learn how to design such a circuit It was clear that Netduino only wasn’t enough to drive a 6&#215;4 led-matrix. First off, for the inability to give enough current for the leds, and secondly for the relative slowness of the managed code running into. The problem in depth.Light up a led is very simple. Starting from the power supply, as parameter you have the current flowing through the led, then calculating the resistor to put in series. A led needs from few mA (SMDs), to several hundreds of mA (or even more) for the high-power class.Let’s face the multiplex problem thinking to a normal discrete-led which needs 10 mA for a normal brightness. So, what is a multiplex?The multiplexing is a technique for driving many loads (e.g. leds), using a relatively low number of wires. Thinking to a 6&#215;4 led-matrix, instead having 24 wires (one for each led), the multiplex-way needs only 6&amp;#43;4 = 10 wires at all. The tri</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/Entering-the-LED-Matrix-with-Netduino</link>
      <pubDate>Fri, 02 Nov 2012 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/Entering-the-LED-Matrix-with-Netduino</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/373a0cd1-041a-45fd-8fbe-c42564def8f5.png" height="67" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/e9a482ab-6624-4c5d-aeb2-89c5240a939e.png" height="147" width="220"></media:thumbnail>      
      <dc:creator>Greg Duncan</dc:creator>
      <itunes:author>Greg Duncan</itunes:author>
      <slash:comments>1</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/Entering-the-LED-Matrix-with-Netduino/RSS</wfw:commentRss>
      <category>.NET Micro Framework</category>
      <category>C#</category>
      <category>Coding4Fun</category>
      <category>Hardware</category>
    </item>
  <item>
      <title>Boxing Bots: An Overview</title>
      <description><![CDATA[<h2>Introduction</h2><p>In early January, we were tasked with creating a unique, interactive experience for the <a href="http://sxsw.com/interactive">SXSW Interactive</a> launch party with <a href="http://www.frogdesign.com/">Frog Design</a>. We bounced around many ideas, and finally settled on a project that Rick suggested during our first meeting: boxing robots controlled via Kinect.</p><p>The theme of the opening party was Retro Gaming, so we figured creating a life size version of a classic tabletop boxing game mashed up with a &quot;Real Steel&quot;-inspired Kinect experience would be a perfect fit. Most importantly, since this was going to be the first big project of the new Coding4Fun team, we wanted to push ourselves to create an experience that needed each of us to bring our unique blend of hardware, software, and interaction magic to the table under an aggressively tight deadline.</p><h2>Hardware</h2><p>The BoxingBots had to be fit a few requirements:</p><ol><li>They had to be fun </li><li>They had to survive for 4 hours, the length of the SXSW opening party </li><li>Each robot had to punch for 90 seconds at a time, the length of a round </li><li>They had to be life-size </li><li>They had to be Kinect-drivable </li><li>They had to be built, shipped, and reassembled for SXSW </li></ol><p>Creating a robot that could be beaten up for 4 hours and still work proved to be an interesting problem. After doing some research on different configurations and styles, it was decided we should leverage a prior project to get a jump start to meet the deadline. We repurposed sections of our Kinect drivable lounge chair, <a href="http://channel9.msdn.com/coding4fun/articles/Jellybean-the-Kinect-Drivable-Lounge-Chair">Jellybean</a>! This was an advantage because it contained many known items, such as the motors, motor controllers, and chassis material.&nbsp; Additionally, it was strong and fast, it was modular, and the code to drive it was already written.</p><p>Jellybean would only get us part of the way there, however.&nbsp; We also had to do some retrofitting to get it to work for our new project. The footprint of the base needed to shrink from 32x50 inches to 32x35 inches, while still allowing space to contain all of the original batteries, wheels, motors, motor controllers, switches, voltage adapters. We also had to change how the motors were mounted with this new layout, as well as provide for a way to easily &quot;hot swap&quot; the batteries out during the event. Finally, we had to mount an upper body section that looked somewhat human, complete with a head and punching arms.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0087%5B4%5D.jpg"><img title="IMG_0087" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0087_thumb%5B1%5D.jpg" alt="IMG_0087" width="240" height="180" border="0"></a>&nbsp;<a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0089%5B9%5D.jpg"><img title="IMG_0089" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0089_thumb%5B4%5D.jpg" alt="IMG_0089" width="240" height="180" border="0"></a><br><strong>Experimenting with possible layouts</strong></p><p>The upper body had its own challenges, as it had to support a ton of equipment, including:</p><ul><li>Punching arms </li><li>Popping head </li><li>Pneumatic valves </li><li>Air manifold </li><li>Air Tank(s) </li><li>Laptop </li><li>Phidget interface board </li><li>Phidget relay boards </li><li>Phidget LED board </li><li>Xbox wireless controller PC transmitter / receiver </li><li>Chest plate </li><li>LEDs </li><li>Sensors to detect a punch </li></ul><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0113%5B5%5D.jpg"><img title="IMG_0113" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0113_thumb%5B2%5D.jpg" alt="IMG_0113" width="500" height="667" border="0"></a><br><strong>Brian and Rick put together one of the upper frames</strong></p><h3>Punching and Air Tanks</h3><p>We had to solve the problem of getting each robot to punch hard enough to register a hit on the opponent bot while not breaking the opponent bot (or itself). Bots also had to withstand a bit of side load in case the arms got tangled or took a side blow. Pneumatic actuators provided us with a lot of flexibility over hydraulics or an electrical solution since they are fast, come in tons of variations, won't break when met with resistance, and can fine tuned with a few onsite adjustments.</p><p>To provide power to the actuators, the robots had two 2.5 gallon tanks pressurized to 150psi, with the actuators punching at ~70psi.&nbsp; We could punch for about five 90-second rounds before needing to re-pressurize the tanks.&nbsp; Pressurizing the onboard tanks was taken care of by a pair of off-the-shelf DeWalt air compressors.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0134%5B4%5D.jpg"><img title="IMG_0134" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0134_thumb%5B1%5D.jpg" alt="IMG_0134" width="240" height="180" border="0"></a>&nbsp;<a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0184%5B4%5D.jpg"><img title="IMG_0184" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0184_thumb%5B1%5D.jpg" alt="IMG_0184" width="240" height="180" border="0"></a><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0279%5B4%5D.jpg"><img title="IMG_0279" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0279_thumb%5B1%5D.jpg" alt="IMG_0279" width="240" height="180" border="0"></a>&nbsp;<a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0172%5B4%5D.jpg"><img title="IMG_0172" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0172_thumb%5B1%5D.jpg" alt="IMG_0172" width="240" height="180" border="0"></a></p><h3>The Head</h3><p>It wouldn’t be a polished game if the head didn’t pop up on the losing bot, so we added another pneumatic actuator to raise and lower the head, and some extra red and blue LEDs. This pneumatic is housed in the chest of the robot and is triggered only when the game has ended.</p><p>To create the head, we first prototyped a concept with cardboard and duct tape. A rotated welding mask just happened to provide the shape we were going for on the crown, and we crafted each custom jaw with a laser cutter.&nbsp; We considered using a mold and vacuum forming to create something a bit more custom, but had to scrap the idea due to time constraints.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0169%5B4%5D.jpg"><img title="IMG_0169" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0169_thumb%5B1%5D.jpg" alt="IMG_0169" width="240" height="180" border="0"></a>&nbsp;<a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0201%5B4%5D.jpg"><img title="IMG_0201" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0201_thumb%5B1%5D.jpg" alt="IMG_0201" width="240" height="180" border="0"></a>&nbsp;<a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0268%5B4%5D.jpg"><img title="IMG_0268" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0268_thumb%5B1%5D.jpg" alt="IMG_0268" width="240" height="180" border="0"></a>&nbsp;<a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0291%5B4%5D.jpg"><img title="IMG_0291" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0291_thumb%5B1%5D.jpg" alt="IMG_0291" width="240" height="180" border="0"></a></p><h3>Sensors</h3><p>Our initial implementation for detecting punches failed due to far too many false positives. We thought using IR distance sensors would be a good solution since we could detect a “close” punch and tell the other robot to retract the arm before real contact. The test looked promising, but in practice, when the opposite sensors were close, we saw a lot of noise in the data. The backup and currently implemented solution was to install simple push switches in the chest and detect when those are clicked by the chest plate pressing against them.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0200%5B4%5D.jpg"><img title="IMG_0200" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0200_thumb%5B1%5D.jpg" alt="IMG_0200" width="240" height="180" border="0"></a>&nbsp;<a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0205%5B4%5D.jpg"><img title="IMG_0205" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0205_thumb%5B1%5D.jpg" alt="IMG_0205" width="240" height="180" border="0"></a></p><h3>Power</h3><p>Different items required different voltages. The motors and pneumatic valves required 24V, the LEDs required 12V and the USB hub required 5V. We used Castle Pro BEC converters to step down the voltages. These devices are typically used in RC airplanes and helicopters.</p><h3>Shipping</h3><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0278%5B4%5D.jpg"><img title="IMG_0278" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0278_thumb%5B1%5D.jpg" alt="IMG_0278" width="240" height="180" border="0"></a>&nbsp;<a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0280%5B4%5D.jpg"><img title="IMG_0280" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0280_thumb%5B1%5D.jpg" alt="IMG_0280" width="240" height="180" border="0"></a></p><p>So how does someone ship two 700lb robots from Seattle to Austin? We did it in 8 crates. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' />. The key thing to note is that the tops and bottoms of each robot were separated. Any wire that connected the two parts had to be able to be disconnected in some form. This affected the serial cords and the power cords (5V, 12V, 24V).</p><h2>Software</h2><p>The software and architecture went through a variety of iterations during development. The final architecture used 3 laptops, 2 desktops, an access point, and a router. It's important to note that the laptops of Robot 1 and Robot 2 are physically mounted on the backs of each Robot body, communicating through WiFi to the Admin console. The entire setup looks like the following diagram:</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/network%5B4%5D.png"><img title="network" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/network_thumb%5B2%5D.png" alt="network" width="387" height="426" border="0"></a></p><h3><strong>Admin Console</strong></h3><p>The heart of the infrastructure is the Admin Console. Originally, this was also intended to be a scoreboard to show audience members the current stats of the match, but as we got further into the project, we realized this wouldn't be necessary. The robots are where the action is, and people's eyes focus there. Additionally, the robots themselves display their current health status via LEDs, so duplicating this information isn't useful. However, the admin side of this app remains.</p><h3><strong>Sockets</strong></h3><p>The admin console is the master controller for the game state and utilizes socket communication between it, the robots, and the user consoles. A generic socket handler was written to span each computer in the setup. The <strong>SocketListener</strong> object allows for incoming connections to be received, while the <strong>SocketClient</strong> allows clients to connect to those <strong>SocketListeners</strong>. These are generic objects, which must specify objects of type <strong>GamePacket</strong> to send and receive:</p><p><pre class="brush: csharp">
public class SocketListener&lt;TSend, TReceive&gt; where TSend : GamePacket                                                
                                             where TReceive : GamePacket, new()
</pre></p><p><br>&nbsp;</p><p><strong>GamePacket</strong> is a base class from which specific packets inherit:</p><p><pre class="brush: csharp">
public abstract class GamePacket
{
    public byte[] ToByteArray() 
    {   
        MemoryStream ms = new MemoryStream();           
        BinaryWriter bw = new BinaryWriter(ms);
                
        try
        {           
            WritePacket(bw);
        }
        catch(IOException ex)
        {
            Debug.WriteLine(&quot;Error writing packet: &quot; &#43; ex);
        }
        
        return ms.ToArray();
    }
        
    public void FromBinaryReader(BinaryReader br)
    {        
        try
        {    
            ReadPacket(br);       
        }
        catch(IOException ex)       
        {
            Debug.WriteLine(&quot;Error reading packet: &quot; &#43; ex);
        }
    }
    
    public abstract void WritePacket(BinaryWriter bw);
    public abstract void ReadPacket(BinaryReader br);
}
</pre></p><p>For example, in communication between the robots and the admin console, <strong>GameStatePacket</strong> and <strong>MovementDescriptorPacket</strong> are sent and received. Each <strong>GamePacket</strong> must implement its own <strong>ReadPacket</strong> and <strong>WritePacket</strong> methods to serialize itself for sending across the socket.</p><p>Packets are sent between machines every &quot;frame&quot;. We need the absolute latest game state, robot movement, etc. at all times to ensure the game is functional and responsive.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image%5B20%5D-2.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb%5B12%5D-3.png" alt="image" width="640" height="278" border="0"></a></p><p>As is quite obvious, absolutely no effort was put into making the console &quot;pretty&quot;. This is never seen by the end users and just needs to be functional. Once the robot software and the user consoles are started, the admin console initiates connections to each of those four machines. Each machine runs the <strong>SocketListener</strong> side of the socket code, while the Admin console creates four <strong>SocketClient</strong> objects to connect to each those. Once connected, the admin has control of the game and can start, stop, pause, and reset a match by sending the appropriate packets to everyone that is connected.</p><h3><strong>Robot</strong></h3><p>The robot UI is also never intended to be seen by an end user, and therefore contains only diagnostic information.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image%5B19%5D-1.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb%5B11%5D-1.png" alt="image" width="640" height="361" border="0"></a></p><p>Each robot has a wireless Xbox 360 controller connected to it so it can be manually controlled. The UI above reflects the positions of the controller sticks and buttons. During a match, it's possible for a bot to get outside of our &quot;safe zone&quot;. One bot might be pushing the other, or the user may be moving the bot toward the edge of the ring. To counter this, the player's coach can either temporarily move the bot, turning off Kinect input, or force the game into &quot;referee mode&quot; which pauses the entire match and turns off Kinect control on both sides. In either case, the robots can be driven with the controllers and reset to safe positions. Once both coaches signal that the robots are reset, the admin can then resume the match.</p><h3>Controlling Hardware</h3><p>Phidget hardware controlled our LEDs, relays, and sensors. Getting data out of a Phidget along with actions, such as opening and closing a relay, is shockingly easy as they have pretty straightforward C# APIs and samples, which is why they typically are our go-to product for projects like this.</p><p>Below are some code snippets for the LEDs, relays, and sensor.</p><p><strong>LEDs – from LedController.cs</strong></p><p>This is the code that actually updates the health LEDs in the robot's chest. The LEDs were put on the board in a certain order to allow this style of iteration. We had a small issue of running out of one color of LEDs so we used some super bright ones and had to reduce the power levels to the non-super bright LEDs to prevent possible damage:</p><p><pre class="brush: csharp">
private void UpdateLedsNonSuperBright(int amount, int offset, int brightness)
{
    for (var i = offset; i &lt; amount &#43; offset; i&#43;&#43;)
    {
        _phidgetLed.leds[i] = brightness / 2;
    }
}

private void UpdateLedsSuperBright(int amount, int offset, int brightness)
{
    for (var i = offset; i &lt; amount &#43; offset; i&#43;&#43;)
    {
        _phidgetLed.leds[i] = brightness;
    }
}
</pre></p><p>&nbsp;</p><p><strong>Sensor data – from SensorController.cs</strong></p><p>This code snippet shows how we obtain the digital and analog inputs from the Phidget 8/8/8 interface board:</p><p><pre class="brush: csharp">
public SensorController(InterfaceKit phidgetInterfaceKit) : base(phidgetInterfaceKit)
{    
    PhidgetInterfaceKit.ratiometric = true;
}

public int PollAnalogInput(int index)
{
    return PhidgetInterfaceKit.sensors[index].Value;
}

public bool PollDigitalInput(int index)
{
    return PhidgetInterfaceKit.inputs[index];
}
</pre></p><p>&nbsp;</p><p><strong>Relays – from RelayController.cs</strong></p><p>Electrical relays fire our pneumatic valves. These control the head popping and the arms punching. For our application, we wanted the ability to reset the relay automatically. When the relay is opened, an event is triggered and we create an actively polled thread to validate whether we should close the relay. The reason why we actively poll is someone could be quickly toggling the relay. We wouldn't want to close it on accident. The polling and logic does result in a possible delay or early trigger for closing the relay, but for the BoxingBots the difference of 10ms for a relay closing is acceptable:</p><p><pre class="brush: csharp">
public void Open(int index, int autoCloseDelay)
{   
    UseRelay(index, true, autoCloseDelay);
}

public void Close(int index)
{
    UseRelay(index, false, 0);
}

private void UseRelay(int index, bool openRelay, int autoCloseDelay)
{
    AlterTimeDelay(index, autoCloseDelay);
    PhidgetInterfaceKit.outputs[index] = openRelay;
}

void _relayController_OutputChange(object sender, OutputChangeEventArgs e)
{
    // closed
    if (!e.Value)
        return;

    ThreadPool.QueueUserWorkItem(state =&gt;
    {                                          
        if (_timeDelays.ContainsKey(e.Index))
        {                                              
            while (_timeDelays[e.Index] &gt; 0)                       
            {
                Thread.Sleep(ThreadTick);           
                _timeDelays[e.Index] -= ThreadTick;
            }                                            
        }
                                            
        Close(e.Index);
                                        
    });
}

public int GetTimeDelay(int index)
{
    if (!_timeDelays.ContainsKey(index))
        return 0;
    return _timeDelays[index];
}

public void AlterTimeDelay(int index, int autoCloseDelay)
{
    _timeDelays[index] = autoCloseDelay;
}
</pre></p><p>&nbsp;</p><h3><strong>User Console</strong></h3><p>&nbsp;</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0297%5B5%5D.jpg"><img title="IMG_0297" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0297_thumb%5B2%5D.jpg" alt="IMG_0297" width="500" height="375" border="0"></a></p><p>Since the theme of the party was Retro Gaming, we wanted to go for an early 80's Sci-fi style interface, complete with starscape background and solar flares! We wanted to create actual interactive elements, though, to maintain the green phosphor look of early monochrome monitors. Unlike traditional video games, however, the screens are designed not as the primary focus of attention, but rather to help calibrate the player before the round and provide secondary display data during the match. The player should primarily stay focused on the boxer during the match, so the interface is designed to sit under the players view line and serve as more of a dashboard during each match.</p><p>However, during calibration before each round, it is important to have the player understand how their core body will be used to drive the Robot base during each round. To do this, we needed to track an average of the joints that make up each fighter's body core. We handled the process by creating a list of core joints and a variable that normalizes the metric distances returned from the Kinect sensor into a human-acceptable range of motion:</p><p><pre class="brush: csharp">
private static List&lt;JointType&gt; coreJoints = newList&lt;JointType&gt;( 
    newJointType[] {
        JointType.AnkleLeft,
        JointType.AnkleRight,
        JointType.ShoulderCenter,
        JointType.HipCenter
    });
private const double RangeNormalizer = .22;
private const double NoiseClip = .05;
</pre></p><p>And then during each skeleton calculation called by the game loop, we average the core positions to determine the averages of the players as they relate to their playable ring boundary:</p><p><pre class="brush: csharp">
public staticMovementDescriptorPacket AnalyzeSkeleton(Skeleton skeleton)
{           
    // ...

    CoreAverageDelta.X = 0.0;
    CoreAverageDelta.Z = 0.0;
    foreach (JointType jt in CoreJoints)
    {
        CoreAverageDelta.X &#43;= skeleton.Joints[jt].Position.X - RingCenter.X;
        CoreAverageDelta.Z &#43;= skeleton.Joints[jt].Position.Z - RingCenter.Z;
    }

    CoreAverageDelta.X /= CoreJoints.Count * RangeNormalizer;
    CoreAverageDelta.Z /= CoreJoints.Count * RangeNormalizer;

    // ...

    if (CoreAverageDelta.Z &gt; NoiseClip || CoreAverageDelta.Z &lt; -NoiseClip)
    {
        packet.Move = -CoreAverageDelta.Z;
    }

    if (CoreAverageDelta.X &gt; NoiseClip || CoreAverageDelta.X &lt; -NoiseClip)
    {
        packet.Strafe = CoreAverageDelta.X;
    }
}
</pre></p><p>In this way, we filter out insignificant data noise and allow the player's average core body to serve as a joystick for driving the robot around. Allowing them to lean at any angle, the move and strafe values are accordingly set to allow for a full 360 degrees of movement freedom, while at the same time not allowing any one joint to unevenly influence their direction of motion.</p><p>Another snippet of code that may be of interest is the WPF3D rendering we used to visualize the skeleton. Since the Kinect returns joint data based off of a center point, it is relatively easy to wire up a working 3D model in WPF3D off of the skeleton data, and we do this in the ringAvatar.xaml control.</p><p>In the XAML, we simply need a basic <strong>Viewport3D</strong> with camera, lights, and an empty <strong>ModelVisual3D</strong> container to hold or squares. The empty container looks like this:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p><p><pre class="brush: xml">
&lt;ModelVisual3D x:Name=&quot;viewportModelsContainer2&quot;&gt;                   
    &lt;ModelVisual3D.Transform&gt;
        &lt;Transform3DGroup&gt;           
            &lt;RotateTransform3D x:Name=&quot;bodyRotationCenter&quot; CenterX=&quot;0&quot; CenterY=&quot;0&quot; CenterZ=&quot;0&quot;&gt;      
                &lt;RotateTransform3D.Rotation&gt;             
                    &lt;AxisAngleRotation3D x:Name=&quot;myAngleRotation&quot; Axis=&quot;0,1,0&quot; Angle=&quot;-40&quot;/&gt;                 
                &lt;/RotateTransform3D.Rotation&gt;           
            &lt;/RotateTransform3D&gt; 
        &lt;/Transform3DGroup&gt; 
    &lt;/ModelVisual3D.Transform&gt;
&lt;/ModelVisual3D&gt;
</pre></p><p>In the code, we created a generic <strong>WPF3DModel</strong> that inherits from <strong>UIElement3D</strong> and is used to store the basic positioning properties of each square. In the constructor of the object, though, we can pass a reference key to a XAML file that defines the 3D mesh to use:</p><p><pre class="brush: csharp">
public WPF3DModel(string resourceKey)
{
    this.Visual3DModel = Application.Current.Resources[resourceKey] as Model3DGroup;
}
</pre></p><p>This is a handy trick when you need to do a fast WPF3D demo and require a certain level of flexibility. To create a 3D cube for each joint when ringAvatar is initialized, we simply do this:</p><p><pre class="brush: csharp">
private readonly List&lt;WPF3DModel&gt; _models = new List&lt;WPF3DModel&gt;();
private void CreateViewportModels()
{           
    for (int i = 0; i &lt; 20; i&#43;&#43;)
    { 
        WPF3DModel model = new WPF3DModel(&quot;mesh_cube&quot;);
        viewportModelsContainer2.Children.Add(model);

        // ...

        _models.Add(model);
    }

    // ...
}
</pre></p><p>And then each time we need to redraw the skeleton, we loop through the skeleton data and set the cube position like so:</p><p><pre class="brush: csharp">
if (SkeletonProcessor.RawSkeleton.TrackingState == SkeletonTrackingState.Tracked)
{
    int i = 0;  

    foreach (Joint joint in SkeletonProcessor.RawSkeleton.Joints)
    {
        if (joint.TrackingState == JointTrackingState.Tracked)
        {
                                        
            _models[i].Translate(                                        
                joint.Position.X * 8.0,                                    
                joint.Position.Y * 10.0,
                joint.Position.Z * -10.0);

            i&#43;&#43;;
        }
    }

    // ...

}
</pre></p><p>There are a few other areas in the User Console that you may want to further dig into, including the weighting for handling a punch as well dynamically generating arcs based on the position of the fist to the shoulder. However, for this experience, the User Console serves as a secondary display to support the playing experience and gives both the player and audience a visual anchor for the game.</p><h3>Making a 700lb Tank Drive like a First Person Shooter</h3><p>The character in a first person shooter (FPS) video game has an X position, a Y position, and a rotation vector. On an Xbox controller, the left stick controls the X,Y position. Y is the throttle (forward and backward), X is the strafing amount (left and right), and the right thumb stick moves the camera to change what you're looking at (rotation).&nbsp; When all three are combined, the character can do things such as run around someone while looking at them.</p><p>In the prior project, we had existing code that worked for controlling all 4 motors at the same time, working much like a tank does, so we only had throttle (forward and back) and strafing (left and right). Accordingly, we can move the motors in all directions, but there are still scenarios in which the wheels fight one another and the base won't move. By moving to a FPS style, we eliminate the ability to move the wheels in an non-productive way and actually make it a lot easier to drive.</p><p>Note that Clint had some wiring &quot;quirks&quot; with polarity and which motor was left VS right, he had to correct in these quirks in software <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' />:</p><p><pre class="brush: csharp">
public Speed CalculateSpeed(double throttleVector, double strafeVector, double rotationAngle)
{
    rotationAngle = VerifyLegalValues(rotationAngle);
    rotationAngle = AdjustValueForDeadzone(rotationAngle, AllowedRotationAngle, _negatedAllowedRotationAngle);

    // flipped wiring, easy fix is here  
    throttleVector *= -1;
    rotationAngle *= -1;
    
    // miss wired, had to flip throttle and straff for calc
    return CalculateSpeed(strafeVector &#43; rotationAngle, throttleVector, strafeVector - rotationAngle, throttleVector);
}

protected Speed CalculateSpeed(double leftSideThrottle, double leftSideVectorMultiplier, double rightSideThrottle, double rightSideVectorMultiplier) 
{ /* code from Jellybean */ }
</pre></p><h2>Conclusion</h2><p>The Boxing Bots project was one of the biggest things we have built to date. It was also one of our most successful projects. Though it was a rainy, cold day and night in Austin when the bots were revealed, and we had to move locations several times during setup to ensure the bots and computers wouldn't be fried by the rain, they ran flawlessly for the entire event and contestants seemed to have a lot of fun driving them.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0302%5B5%5D.jpg"><img title="IMG_0302" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0302_thumb%5B2%5D.jpg" alt="IMG_0302" width="500" height="375" border="0"></a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:247dcab61560403d8e5da04e01521034">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Boxing-Bots-An-Overview</comments>
      <itunes:summary>IntroductionIn early January, we were tasked with creating a unique, interactive experience for the SXSW Interactive launch party with Frog Design. We bounced around many ideas, and finally settled on a project that Rick suggested during our first meeting: boxing robots controlled via Kinect. The theme of the opening party was Retro Gaming, so we figured creating a life size version of a classic tabletop boxing game mashed up with a &amp;quot;Real Steel&amp;quot;-inspired Kinect experience would be a perfect fit. Most importantly, since this was going to be the first big project of the new Coding4Fun team, we wanted to push ourselves to create an experience that needed each of us to bring our unique blend of hardware, software, and interaction magic to the table under an aggressively tight deadline. HardwareThe BoxingBots had to be fit a few requirements: They had to be fun They had to survive for 4 hours, the length of the SXSW opening party Each robot had to punch for 90 seconds at a time, the length of a round They had to be life-size They had to be Kinect-drivable They had to be built, shipped, and reassembled for SXSW Creating a robot that could be beaten up for 4 hours and still work proved to be an interesting problem. After doing some research on different configurations and styles, it was decided we should leverage a prior project to get a jump start to meet the deadline. We repurposed sections of our Kinect drivable lounge chair, Jellybean! This was an advantage because it contained many known items, such as the motors, motor controllers, and chassis material.&amp;nbsp; Additionally, it was strong and fast, it was modular, and the code to drive it was already written. Jellybean would only get us part of the way there, however.&amp;nbsp; We also had to do some retrofitting to get it to work for our new project. The footprint of the base needed to shrink from 32x50 inches to 32x35 inches, while still allowing space to contain all of the original batteries, wheels, motors, m</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/Boxing-Bots-An-Overview</link>
      <pubDate>Thu, 04 Oct 2012 21:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Boxing-Bots-An-Overview</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/959a6e59-5e5d-4824-aff5-01cc0ea75b19.png" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/ecb530a9-ffa6-418d-a3e1-96fec970031b.png" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/48e5dab5-8103-4fc6-a3a6-9bd49223e294.jpg" height="288" width="512"></media:thumbnail>      
      <dc:creator>Brian Peek, Clint Rutkas, Dan Fernandez, Rick Barraza</dc:creator>
      <itunes:author>Brian Peek, Clint Rutkas, Dan Fernandez, Rick Barraza</itunes:author>
      <slash:comments>10</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/Boxing-Bots-An-Overview/RSS</wfw:commentRss>
      <category>Hardware</category>
      <category>Kinect</category>
      <category>WPF</category>
      <category>Phidgets</category>
    </item>
  <item>
      <title>&quot;Gadgetab – the Gadgeteer Tablet&quot;</title>
      <description><![CDATA[<p>Today's Hardware Friday project from Ian Lee, Sr. is one that's not our usual kind of hardware project, it's hardware as in real hardware... With all the recent talk of tablets, well how could we let this go bye without a mention?</p><h2><a href="http://blog.ianlee.info/2012/08/gadgetab-gadgeteer-tablet.html" target="_blank">Gadgetab – the Gadgeteer Tablet</a></h2><blockquote><p><strong>This story…</strong></p><p>…begins a couple years ago when I started the <a href="http://blog.ianlee.info/2011/08/omnicopter-getting-off-ground.html">Omnicopter</a>.&nbsp; To fly the copter, I needed a remote.&nbsp; So, I built the Omnimote (right).&nbsp; It was a <a href="http://www.ghielectronics.com/catalog/product/256">Panda-II</a> powered remote that used <a href="http://www.digi.com/products/wireless/zigbee-mesh/xbee-series2-module.jsp">XBee</a> to communicate with the copter.&nbsp; It also had a small (slow) FEZ Touch display that was useful for displaying some info but had limited ability as a touch screen due to it being a resistive touch screen and it was just too slow to be depended on for use during flight.</p><p>As I’ve built other projects since then, it’s become more and more evident that I have a need for a universal device that can communicate and display information with other projects.&nbsp;</p><p>In the past year, most of my focus has been drawn toward the Gadgeteer platform for electronics prototyping.&nbsp; It’s a much more flexible and productive platform than anything else that exists at the moment and has dozens of powerful modules (subcircuits) that can be attached to it.&nbsp; Gadgeteer has become my go-to platform when developing electronics projects.</p><p>I’ve been doing quite a bit of Gadgeteer evangelizing the past year by giving <a href="http://nashdotnet.org/?s=Ian&#43;Lee&amp;submit=Search">presentations</a> at our local <a href="http://nashdotnet.org">.NET users’ group</a> and at conferences.&nbsp; I’m also starting the <a href="http://nashmicro.net">Nashville Microcontrollers users’ group</a>.&nbsp; So, the desire to have a truly portable and compact solution for demoing Gadgeteer in addition to something that is useful for my other projects has become a little more important.</p><p>However, one piece has been missing to allow me to build the Gadgetab of my dreams – a large capacitive touch display. <a href="http://www.ghielectronics.com/">GHI Electronics</a> recently solved that problem with the release of their <a href="http://www.ghielectronics.com/catalog/product/376">CP7 module</a> – a 7” capacitive touch display.&nbsp; So, let the building begin!</p><p>The design goal was to build a tablet type device that could be useful as a remote, demo device, have some room for storage, be battery powered, and look nice – lots of software &amp; sawdust.</p></blockquote><p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/ieanloly1CY&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/ieanloly1CY&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p><p>Ian takes us from hardware;</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B2%5D-72.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb-72.png" alt="image" width="543" height="407" border="0"></a></p><p>To hardware...</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B5%5D-33.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B1%5D-78.png" alt="image" width="535" height="407" border="0"></a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:ef09ac0056e7481c802ba0b8014d05ff">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/Gadgetab--the-Gadgeteer-Tablet</comments>
      <itunes:summary>Today&#39;s Hardware Friday project from Ian Lee, Sr. is one that&#39;s not our usual kind of hardware project, it&#39;s hardware as in real hardware... With all the recent talk of tablets, well how could we let this go bye without a mention? Gadgetab – the Gadgeteer TabletThis story… …begins a couple years ago when I started the Omnicopter.&amp;nbsp; To fly the copter, I needed a remote.&amp;nbsp; So, I built the Omnimote (right).&amp;nbsp; It was a Panda-II powered remote that used XBee to communicate with the copter.&amp;nbsp; It also had a small (slow) FEZ Touch display that was useful for displaying some info but had limited ability as a touch screen due to it being a resistive touch screen and it was just too slow to be depended on for use during flight. As I’ve built other projects since then, it’s become more and more evident that I have a need for a universal device that can communicate and display information with other projects.&amp;nbsp; In the past year, most of my focus has been drawn toward the Gadgeteer platform for electronics prototyping.&amp;nbsp; It’s a much more flexible and productive platform than anything else that exists at the moment and has dozens of powerful modules (subcircuits) that can be attached to it.&amp;nbsp; Gadgeteer has become my go-to platform when developing electronics projects. I’ve been doing quite a bit of Gadgeteer evangelizing the past year by giving presentations at our local .NET users’ group and at conferences.&amp;nbsp; I’m also starting the Nashville Microcontrollers users’ group.&amp;nbsp; So, the desire to have a truly portable and compact solution for demoing Gadgeteer in addition to something that is useful for my other projects has become a little more important. However, one piece has been missing to allow me to build the Gadgetab of my dreams – a large capacitive touch display. GHI Electronics recently solved that problem with the release of their CP7 module – a 7” capacitive touch display.&amp;nbsp; So, let the building begin! The design goal was to build a </itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/Gadgetab--the-Gadgeteer-Tablet</link>
      <pubDate>Fri, 31 Aug 2012 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/Gadgetab--the-Gadgeteer-Tablet</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/a1bf6950-4d1b-48eb-8955-b5e261ed22ee.png" height="76" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/5201a41d-7f73-42b0-a4e3-64cd397d17f0.png" height="167" width="220"></media:thumbnail>      
      <dc:creator>Greg Duncan</dc:creator>
      <itunes:author>Greg Duncan</itunes:author>
      <slash:comments>3</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/Gadgetab--the-Gadgeteer-Tablet/RSS</wfw:commentRss>
      <category>Coding4Fun</category>
      <category>Hardware</category>
    </item>
  <item>
      <title>Using the Adafruit Arduino Logger Shield on a Netduino</title>
      <description><![CDATA[<p><strong>C9 Netduino Shield Series - Using Arduino Shields with a Netduino - Part II</strong></p><h4>Introduction</h4><p>In our <a href="http://channel9.msdn.com/coding4fun/articles/What-Is-an-Arduino-Shield-and-Why-Should-My-Netduino-Care">previous article</a>, we examined what an Arduino shield is, how to build a simple custom shield and discussed how to quickly identify shields that are good candidates for a Netduino adaptation versus shields that may not be.</p><p>In this article, we’ll take a <a href="https://www.adafruit.com/products/243">popular Arduino Logger Shield produced by Adafruit</a> and we’ll interface it with a Netduino / Plus microcontroller</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image%5B10%5D-2.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb%5B6%5D-4.png" alt="image" width="240" height="188" border="0"></a></p><p>The Arduino Logger Shield is an excellent one to start with because it offers immediate benefits to a Netduino / Plus user:</p><ul><li>Time-keeping </li><li>SD card storage </li><li>Two user-controllable LEDs </li><li>A small prototyping area </li><li>An onboard 3.3v voltage regulator for clean analog readings and power decoupling </li></ul><p>In our <a href="http://netduinohelpers.codeplex.com/SourceControl/list/changesets">C# data logging application</a>, we'll interact with the time keeper, the SD card storage and its 'card detect' pin, the two LEDs as well as a temperature sensor (not included with the shield).</p><p>Before diving into the details associated with the hardware, you may want to take a look at the C# objects representing the hardware:</p><p><pre class="brush: csharp">
public static readonly string SdMountPoint = &quot;SD&quot;;
public static OutputPort LedRed = new OutputPort(Pins.GPIO_PIN_D0, false);
public static OutputPort LedGreen = new OutputPort(Pins.GPIO_PIN_D1, false);
public static InputPort CardDetect = new InputPort(Pins.GPIO_PIN_D3, true, Port.ResistorMode.PullUp);
public static readonly Cpu.Pin ThermoCoupleChipSelect = Pins.GPIO_PIN_D2;
public static DS1307 Clock;
public static Max6675 ThermoCouple;
</pre></p><p>and their initialization:</p><p><pre class="brush: csharp">
public static void InitializePeripherals() {
    LedGreen.Write(true);
    Clock = new DS1307();
    ThermoCouple = new Max6675();
    InitializeStorage(true);
    InitializeClock(new DateTime(2012, 06, 14, 17, 00, 00));
    ThermoCouple.Initialize(ThermoCoupleChipSelect);
    TemperatureSampler = new Timer(new TimerCallback(LogTemperature), null, 250, TemperatureLoggerPeriod);
    LedGreen.Write(false);
}
</pre></p><p>The SD card, represented by the <strong>SdMountPoint</strong> string, communicates with the application over SPI. The presence of the SD card in the reader is determined through the <strong>CardDetect</strong> input pin.</p><p>The LEDs are simple outputs that we'll turn ON / OFF as the peripherals gets initialized and file I/Os take place with the SD card.</p><p>The clock communicates with the application over the I2C protocol. The clock's most important functions are accessed through the <em>Set()</em> and <em>Get()</em> methods respectively used to set the time once and to get updated time stamps afterward.</p><p>The thermocouple communicates over SPI with the application. It exposes a <em>Read()</em> method which caches a raw temperature sample accessed through the <em>Celsius</em> and <em>Fahrenheit</em> properties.</p><p>Note: the Netduino Plus already features a built-in microSD card reader, in which case, having another one on the shield is not really needed. Except for this hardware difference, everything else discussed within this article applies equally to the regular Netduino and the Netduino Plus.</p><h4>Interfacing with the Arduino Logger shield’s hardware</h4><p>Adafruit is pretty good about making usable products and generally provides Arduino libraries to use with their hardware. Indeed, the Arduino Logger Shield is <a href="http://www.ladyada.net/make/logshield/index.html">well documented</a> and comes with two C&#43;&#43; libraries: <a href="https://github.com/adafruit/SD">SD</a> which implements a <a href="http://www.ladyada.net/make/logshield/sd.html">FAT file system and supporting low-level SD card I/O functions</a>. <a href="https://github.com/adafruit/RTClib">RTCLib</a> which wraps the I2C interface required to communicate with the <a href="http://www.ladyada.net/make/logshield/rtc.html">DS1307 real time clock.</a></p><h5>The SD Card Interface</h5><p>Let’s deal with the SD card reader and the file system first: a quick review of <a href="https://github.com/adafruit/SD/blob/master/SD.h">SD.h</a> reveals two C&#43;&#43; classes:</p><ul><li>class File : public Stream {} exposing standard read, write, seek, flush file access functions. </li><li>class SDClass {} exposing storage management such as file and directory operations. </li></ul><p>This is good news because the .NET Micro Framework on the Netduino already supports file streams and directory management through the use of the <a href="http://msdn.microsoft.com/en-us/library/hh400764">.NET MF System.IO assembly</a>. This assembly comes with the <a href="http://www.netduino.com/downloads/MicroFrameworkSDK.msi">.NET MF SDK</a> port to the Netduino.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image004%5B3%5D-1.jpg"><img title="clip_image004" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image004_thumb-1.jpg" alt="clip_image004" width="172" height="379" border="0"></a></p><p>By the same token, interfacing with an SD card is provided by an assembly built by Secret Labs named SecretLabs.NETMF.IO which comes with the <a href="http://www.netduino.com/downloads/">Netduino SDK</a>.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image%5B5%5D-6.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb%5B3%5D-6.png" alt="image" width="640" height="114" border="0"></a></p><p>SecretLabs.NETMF.IO provides two functions for 'mounting' and 'un-mounting' an SD card device and <a href="http://en.wikipedia.org/wiki/FAT_file_system">the associated FAT file system</a> so that it can be made usable by the .NET MF through assemblies such as <a href="http://msdn.microsoft.com/en-us/library/hh400764">System.IO.</a></p><p>It's important to note that the SecretLabs.NETMF.IO assembly must not be deployed with an application targeting the <a href="http://www.netduino.com/netduinoplus/specs.htm">Netduino Plus</a>: on boot, the .NET Micro Framework implementation specific to the Netduino Plus automatically detects and mounts the SD card if one is present in its microSD card reader. This functionality is redundant with the MountSD / Unmount functions provided by the SecretLabs.NETMF.IO assembly which is only needed on Netduino SKUs without a built-in SD card reader.</p><h5>How does the .NET MF interact with the SD card through the shield?</h5><p>At this point, it's a good time to review the Arduino Logger Shield's pin-out and the <a href="http://www.ladyada.net/make/logshield/design.html">shield's schematics</a>:</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image%5B16%5D-2.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb%5B10%5D-4.png" alt="image" width="472" height="422" border="0"></a></p><p>As we know from our previous article, pins D10-D13 map to the SPI interface and pins A4-A5 map to the I2C interface of the Netduino. On the shield's schematics, the SPI interface leads us to the SD &amp; MMC section of the diagram, connected through a <a href="http://www.ladyada.net/wiki/partselector/ic?s%5b%5d=74ahc125n#logic">74HC125N logic-level shifter chip</a> indicated as IC3A-D.</p><p>The role of the logic-level shifter is to ensure that logic voltages supplied to the SD card do not exceed 3.3v, even if they come from a microcontroller using 5v logic levels, such as the Arduino. When using an SD card with a Netduino, a level-shifter is not required since all logic levels run at 3.3v on the AT91SAM7x chip but it doesn't interfere with any I/O operations either when the voltage is already 3.3v.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image%5B20%5D-3.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb%5B12%5D-4.png" alt="image" width="640" height="468" border="0"></a></p><p>The SD card reader in itself is just a passive connector, giving access to the controller built into the SD card. It also provides a mechanical means (i.e. switches) of detecting the presence of a card in the reader (see JP14 pin 1) as well as detecting if the card is write-protected (see JP14 pin 2). We'll make use of the card detection pin in the sample temperature logging application later on.</p><p>For background on how SD cards work, the following application note <a href="http://alumni.cs.ucr.edu/~amitra/sdcard/Additional/sdcard_appnote_foust.pdf">&quot;Secure Digital Card Interface for the MSP430&quot;</a> is excellent and much easier to digest than the extensive <a href="https://www.sdcard.org/downloads/pls/simplified_specs/">'simplified' SD card protocol specifications provided on the SD Card Association site</a>. The following table taken from the <a href="http://alumni.cs.ucr.edu/~amitra/sdcard/Additional/sdcard_appnote_foust.pdf">&quot;Secure Digital Card Interface for the MSP430&quot;</a> shows the pin out of an SD card and the corresponding SPI connections:</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image012%5B3%5D-1.jpg"><img title="clip_image012" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image012_thumb-1.jpg" alt="clip_image012" width="285" height="247" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image014%5B3%5D-1.jpg"><img title="clip_image014" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image014_thumb-1.jpg" alt="clip_image014" width="624" height="253" border="0"></a></p><p>An SD standard-compliant card can support 3 distinct access modes, each one providing different performance characteristics:</p><ul><li>SD 1-bit protocol: synchronous serial protocol with one data line, one clock line and one line for commands. The full SD card protocol command set is supported in 1-bit mode. </li><li>SD 4-bit protocol: this mode is nearly identical to the SD 1-bit mode, except that the data is multiplexed over 4 data lines, yielding up to 4x the performance of SD 1-bit mode. The full SD card protocol command set is supported in 4-bit mode. </li><li>SPI mode: provide a standard SPI bus interface (/SS, MOSI, MISO, SCK). In SPI mode, the SD card only supports a subset of the full SD card protocol but it is sufficient for implementing a fully functional storage mechanism with a file system. </li></ul><p>As you might have guessed, the .NET Micro Framework on the Netduino <a href="http://netduino.com/downloads/netduinofirmware/netduinofirmware.zip">makes use of the SD card in SPI mode</a> (see \DeviceCode\Drivers\BlockStorage\SD\SD_BL_driver.cpp). The block-oriented SD card I/Os are abstracted thanks to the FAT file system provided by the System.IO assembly (see \DeviceCode\Drivers\FS\FAT\FAT_FileHandle.cpp and FAT_LogicDisk.cpp).</p><p>The role of the SecretLabs.NETMF.IO assembly on the Netduino (or its built-in equivalent on the Netduino Plus) is to initialize the SD card in SPI mode during the 'mounting' process by sending the proper set of commands as defined in the <a href="https://www.sdcard.org/downloads/pls/simplified_specs/">SD Card protocol</a>.</p><p>In the <a href="http://netduinohelpers.codeplex.com/SourceControl/list/changesets">C# code of the AdafruitNetduinoLogger sample application</a>, which we will review as a whole later on in the code walkthrough section, the following function takes care of the SD card initialization:</p><p><pre class="brush: csharp">
public static void InitializeStorage(bool mount) {
    try {
        if (mount == true) {
            StorageDevice.MountSD(SdMountPoint, SPI.SPI_module.SPI1, Pins.GPIO_PIN_D10);
        } else {
            StorageDevice.Unmount(SdMountPoint);
        }
    } catch (Exception e) {
        LogLine(&quot;InitializeStorage: &quot; &#43; e.Message);
        SignalCriticalError();
    }
}
</pre></p><p>Once mounted, the file system is accessed through System.IO calls such as this:</p><p><pre class="brush: csharp">
using (var tempLogFile = new StreamWriter(filename, true)) {
    tempLogFile.WriteLine(latestRecord);
    tempLogFile.Flush();
}
</pre></p><p>Using the <a href="http://msdn.microsoft.com/en-us/library/hh423706">StreamWriter class</a> in this context made sense for writing strings as used in the sample application:</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image016%5B3%5D-1.jpg"><img title="clip_image016" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image016_thumb-1.jpg" alt="clip_image016" width="203" height="201" border="0"></a></p><p>However, there are many other file I/O classes available in System.IO that may be better suited depending on the scenario.</p><h5>The DS1307 real time clock</h5><p>Our next step is to examine the interface with the DS1307 real time clock (RTC). We'll start by extracting the most important parts of the <a href="http://datasheets.maxim-ic.com/en/ds/DS1307.pdf">DS1307 datasheet</a> and reviewing how it's wired up on the shield's schematics.</p><h5>DS1307 features</h5><ul><li>Real-Time Clock (RTC) Counts Seconds, Minutes, Hours, Date of the Month, Month, Day of the week, and Year with Leap-Year Compensation Valid Up to 2100 </li><li>56-Byte, Battery-Backed, General-Purpose RAM with Unlimited Writes </li><li>I2C Serial Interface </li><li>Programmable Square-Wave Output Signal </li><li>Automatic Power-Fail Detect and Switch Circuitry </li><li>Consumes Less than 500nA in Battery-Backup Mode with Oscillator Running </li></ul><p>Note: If you need to measure the time something takes in milliseconds, a time granularity that the DS1307 clock does not provide, you can use the <a href="http://msdn.microsoft.com/en-us/library/ee437011">Utility functions provided by the .NET Micro Framework</a> like this:</p><p><pre class="brush: csharp">
var tickStart = Utility.GetMachineTime().Ticks;

// &lt;...code to be timed...&gt;

var elapsedMs = (int)((Utility.GetMachineTime().Ticks - tickStart) / TimeSpan.TicksPerMillisecond);
</pre></p><p>This timing method relies on the CPU's internal tick counter and is not 100% accurate due to the overhead of the .NET MF itself but may be sufficient in most scenarios. In addition, the internal tick counter rolls over every so often, something that should be taken into account in production code.</p><h5>DS1307 register map</h5><p>Accessing the clock's features comes down reading and writing to and from a set of registers as described on page 8 of the datasheet.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image018%5B3%5D.jpg"><img title="clip_image018" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image018_thumb.jpg" alt="clip_image018" width="624" height="263" border="0"></a></p><p><a href="http://datasheets.maxim-ic.com/en/ds/DS1307.pdf">Page 9 of the DS1307 datasheet</a> provides more details about the square wave generation function of the clock, which we will not be using here. The generated square wave signal is available on the shield through connector JP14 on pin 3 as you can see on the schematics below and can be used to provide a slow but reliable external clock signal to another device such as a microcontroller.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image020%5B3%5D.jpg"><img title="clip_image020" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image020_thumb.jpg" alt="clip_image020" width="624" height="111" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image022%5B3%5D.jpg"><img title="clip_image022" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/clip_image022_thumb.jpg" alt="clip_image022" width="435" height="382" border="0"></a></p><h5>DS1307 I2C bus address</h5><p>The final piece of the puzzle needed before we can use the DS1307 is the device's address on the I2C data bus and its maximum speed (specified at 100 KHz on page 10 of the datasheet). The device address is revealed on page 12 as being 1101000 binary (0x68) along with the two operations modes (Slave Receiver and Slave Transmitter) of the clock. The 8th bit of the address is used by the protocol to indicate whether a 'read' or a 'write' operation is requested.</p><p>Note: I2C devices sometime make use of 10-bit addresses. If you aren't familiar with the I2C data bus, you should read the section of the datasheet starting on page 10 which provides a good foundation for understanding how I2C generally works.</p><p>It can be summarized as follows:</p><ul><li>I2C is a 2-wire serial protocol with one bidirectional data line referred to as SDA and one clock line, referred to as SCL. </li><li>The I2C bus is an open-drain bus (i.e. devices pull the bus low to create a '0' and let go of the bus to create a '1'). To achieve this, I2C requires a pull-up resistor on the SCL and SDA lines between 1.8K ohms and 10K ohms. I2C devices do not need to provide pull-ups themselves if the bus already has them. </li><li>The I2C master (i.e. the Netduino microcontroller) always provides the clock signal, generally between 100 KHz (or lower) for standard speed devices or 400 KHz for high-speed devices. There's also a <a href="http://www.i2c-bus.org/fast-mode-plus/">'Fast Mode Plus'</a> allowing for speeds up to 1MHz on devices supporting it. There can be more than one master on the bus even though this is uncommon. </li><li>An I2C device can have a 7-bit or 10-bit address, allowing for multiple I2C devices to be used on the same bus. </li><li>I2C read and write operations are transactions initiated by the I2C master targeting a specific device by address. Some I2C slave devices can notify their master that they need to communicate using a bus interrupt. </li><li>A transaction is framed by 'start' and 'stop signals, with each byte transferred requiring an acknowledgement signal. </li></ul><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image9.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb2-1.png" alt="image" width="640" height="202" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image6%5B1%5D.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb1.png" alt="image" width="640" height="195" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image3.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb-4.png" alt="image" width="640" height="194" border="0"></a></p><p>At this point, we have all the pieces needed to communicate with the RTC using I2C transactions.</p><h5>Using the I2C protocol with the .NET Micro Framework</h5><p>On the Arduino, the library used with the shield to communicate with the DS1307 is a <a href="https://github.com/adafruit/RTClib/blob/master/RTClib.cpp">C&#43;&#43; library called RTClib</a>. The <a href="https://github.com/adafruit/RTClib/blob/master/RTClib.h">header</a> of the library declares a <strong>DateTime</strong> class, similar in functionality to the standard <a href="http://msdn.microsoft.com/en-us/library/hh422126">.NET Micro Framework DateTime class provided by System</a> in the mscorlib assembly. We'll use the standard .NET MF data type to work with the clock instead.</p><p>The next declared class is RTC_DS1307 which implements the driver for the DS1307 chip using the <a href="http://arduino.cc/it/Reference/Wire">Wire library to wrap the I2C protocol</a>. The .NET Micro Framework also <a href="http://msdn.microsoft.com/en-us/library/hh435266">supports the I2C protocol</a> through to the <a href="http://msdn.microsoft.com/en-us/library/hh435127">Microsoft.SPOT.Hardware assembly</a>. Here again, we'll use the .NET MF implementation of I2C in order to communicate with the clock. However, the I2C transaction patterns implemented by the C&#43;&#43; driver can still provide a useful guide for writing a C# driver for the DS1307 when you don't know where to begin just based on the datasheet.</p><p>For instance, the following <a href="https://github.com/adafruit/RTClib/blob/master/RTClib.cpp">functions taken from RTClib.cpp</a> shows the call sequence used with the Wiring API to address the date and time registers of the clock:</p><p><pre class="brush: csharp">
int i = 0; //The new wire library needs to take an int when you are sending for the zero register

void RTC_DS1307::adjust(const DateTime&amp; dt) {
    Wire.beginTransmission(DS1307_ADDRESS);
    Wire.write(i);
    Wire.write(bin2bcd(dt.second()));
    Wire.write(bin2bcd(dt.minute()));
    Wire.write(bin2bcd(dt.hour()));
    Wire.write(bin2bcd(0));
    Wire.write(bin2bcd(dt.day()));
    Wire.write(bin2bcd(dt.month()));
    Wire.write(bin2bcd(dt.year() - 2000));
    Wire.write(i);
    Wire.endTransmission();
}

DateTime RTC_DS1307::now() {
    Wire.beginTransmission(DS1307_ADDRESS);
    Wire.write(i);
    Wire.endTransmission();
    Wire.requestFrom(DS1307_ADDRESS, 7);
    uint8_t ss = bcd2bin(Wire.read() &amp; 0x7F);
    uint8_t mm = bcd2bin(Wire.read());
    uint8_t hh = bcd2bin(Wire.read());
    Wire.read();
    uint8_t d = bcd2bin(Wire.read());
    uint8_t m = bcd2bin(Wire.read());
    uint16_t y = bcd2bin(Wire.read()) &#43; 2000;
    return DateTime (y, m, d, hh, mm, ss);
}
</pre></p><p>The final class is RTC_Millis, a utility class converting time data into milliseconds, effectively providing the functionality of the DateTime.Millisecond property on the .NET MF.</p><p>Having assessed that the functionality of RTClib only handles date and time registers and knowing the role of the other clock registers, we can proceed with implementing a complete <a href="http://netduinohelpers.codeplex.com/SourceControl/list/changesets">DS1307 C# driver</a>, supporting the square wave and RAM functions, using the native I2C protocol support of the .NET Micro Framework.</p><p>The driver starts by defining key constants matching the clock registers according to the datasheet:</p><p><pre class="brush: csharp">
[Flags]
// Defines the frequency of the signal on the SQW interrupt pin on the clock when enabled
public enum SQWFreq { SQW_1Hz, SQW_4kHz, SQW_8kHz, SQW_32kHz, SQW_OFF };

[Flags]
// Defines the logic level on the SQW pin when the frequency is disabled
public enum SQWDisabledOutputControl { Zero, One };

// Real time clock I2C address
public const int DS1307_I2C_ADDRESS = 0x68;

// Start / End addresses of the date/time registers
public const byte DS1307_RTC_START_ADDRESS = 0x00;
public const byte DS1307_RTC_END_ADDRESS = 0x06;

// Start / End addresses of the user RAM registers
public const byte DS1307_RAM_START_ADDRESS = 0x08;
public const byte DS1307_RAM_END_ADDRESS = 0x3f;

// Square wave frequency generator register address
public const byte DS1307_SQUARE_WAVE_CTRL_REGISTER_ADDRESS = 0x07;

// Start / End addresses of the user RAM registers
public const byte DS1307_RAM_START_ADDRESS = 0x08;
public const byte DS1307_RAM_END_ADDRESS = 0x3f;

// Total size of the user RAM block
public const byte DS1307_RAM_SIZE = 56;
</pre></p><p>Next the driver defines an I2C device object representing the clock:</p><p><pre class="brush: csharp">
// Instance of the I2C clock
protected I2CDevice Clock;
</pre></p><p>In the class constructor, the I2C clock device is initialized, specifying its address and speed in KHz:</p><p><pre class="brush: csharp">
public DS1307(int timeoutMs = 30, int clockRateKHz = 50) {
    TimeOutMs = timeoutMs;
    ClockRateKHz = clockRateKHz;
    Clock = new I2CDevice(new I2CDevice.Configuration(DS1307_I2C_ADDRESS, ClockRateKHz));
}
</pre></p><p>The driver retrieves the date and time from the clock through a Get function returning a <strong>DateTime</strong> object.</p><p><pre class="brush: csharp">
public DateTime Get() {
    byte[] clockData = new byte [7];

    // Read time registers (7 bytes from DS1307_RTC_START_ADDRESS)
    var transaction = new I2CDevice.I2CTransaction[] {
    I2CDevice.CreateWriteTransaction(new byte[] {DS1307_RTC_START_ADDRESS}),
        I2CDevice.CreateReadTransaction(clockData)
    };

    if (Clock.Execute(transaction, TimeOutMs) == 0) {
        throw new Exception(&quot;I2C transaction failed&quot;);
    }

    return new DateTime(
        BcdToDec(clockData[6]) &#43; 2000, // year
        BcdToDec(clockData[5]), // month
        BcdToDec(clockData[4]), // day
        BcdToDec(clockData[2] &amp; 0x3f), // hours over 24 hours
        BcdToDec(clockData[1]), // minutes
        BcdToDec(clockData[0] &amp; 0x7f) // seconds
    );
}
</pre></p><p>Let's break it down:</p><ul><li>A 7-byte array is allocated which will receive the raw date and time data registers, starting at address DS1307_RTC_START_ADDRESS (0x00) and ending at DS1307_RTC_END_ADDRESS (0x06). </li><li>An I2C transaction object is allocated, comprising two parameters: <ul><li>A 'write' transaction object telling the DS1307 device which register address to start reading data from. In this case, this is DS1307_RTC_START_ADDRESS (0x00), the very first time-keeping register. </li><li>A 'read' transaction object specifying where the clock's time-keeping data registers will be stored, implicitly defining the total number of bytes to be read and acknowledged. </li></ul></li><li>Clock.Execute is the function calling into the .NET MF I2C interface to run the prepared transactions. The second parameter specifies a time out value expressed in milliseconds before the transaction fails, resulting in a generic exception being thrown. </li><li>When the transactions succeed, a DateTime object is instantiated with the 7 time-keeping registers returned by the 'read' transaction. Each register is converted from <a href="http://en.wikipedia.org/wiki/Binary_coded_decimal">Binary Coded Decimal</a> form to decimal form using a custom utility function: </li></ul><p><pre class="brush: csharp">
protected int BcdToDec(int val) {
    return ((val / 16 * 10) &#43; (val % 16));
}
</pre></p><p>Conversely, the driver provides a Set function to update the clock's time-keeping registers. Because the driver doesn't expect a response from the DS1307 in this scenario, the I2C transaction is write-only. The fields of the <strong>DateTime</strong> parameter corresponding to the time -keeping registers are converted from decimal form to <a href="http://en.wikipedia.org/wiki/Binary_coded_decimal">BCD</a> form and stuffed in a 7-byte array before executing the transaction.</p><p><pre class="brush: csharp">
public void Set(DateTime dt) {
    var transaction = new I2CDevice.I2CWriteTransaction[] {
        I2CDevice.CreateWriteTransaction(new byte[] {
            DS1307_RTC_START_ADDRESS,
            DecToBcd(dt.Second),
            DecToBcd(dt.Minute),
            DecToBcd(dt.Hour),
            DecToBcd((int)dt.DayOfWeek),
            DecToBcd(dt.Day),
            DecToBcd(dt.Month),
        DecToBcd(dt.Year - 2000)} )
    };

    if (Clock.Execute(transaction, TimeOutMs) == 0) {
        throw new Exception(&quot;I2C write transaction failed&quot;);
    }
}
</pre></p><p>The rest of the functions provided by the C# driver implement the other DS1307 features, such as</p><ul><li>SetSquareWave </li><li>Halt </li><li>SetRAM </li><li>GetRAM </li><li>The [] operator used to access a specific clock register </li><li>WriteRegister </li></ul><p>In all case, these functions are wrappers around the 'read' and 'write' I2C transaction model, involving the appropriate DS1307 registers as defined in the datasheet.<strong>&nbsp;</strong></p><h4>Using the Adafruit Arduino Logger Shield as a temperature logger</h4><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image15.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb6.png" alt="image" width="640" height="426" border="0"></a></p><p>To illustrate the points discussed so far, we'll use the Adafruit Arduino Logger shield with a Netduino and a <a href="http://www.adafruit.com/products/269">MAX6675 thermocouple amplifier</a> for the purpose of recording ambient temperature samples at ten second intervals.</p><p>Each record includes a date, a time and the temperature expressed in Celsius and Fahrenheit. The records are written to daily files in CSV format for easy export to a spreadsheet, making the application easily adaptable for acquiring data from different sensors:</p><table width="302" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td valign="bottom" width="73"><p><strong>Date</strong></p></td><td valign="bottom" width="83"><p><strong>Time</strong></p></td><td valign="bottom" width="62"><p><strong>Celsius</strong></p></td><td valign="bottom" width="82"><p><strong>Fahrenheit</strong></p></td></tr><tr><td valign="bottom" width="73"><p>6/14/2012</p></td><td valign="bottom" width="83"><p>15:35:00:05</p></td><td valign="bottom" width="62"><p>18.75</p></td><td valign="bottom" width="82"><p>65.75</p></td></tr><tr><td valign="bottom" width="73"><p>6/14/2012</p></td><td valign="bottom" width="83"><p>15:35:10:05</p></td><td valign="bottom" width="62"><p>18</p></td><td valign="bottom" width="82"><p>64.4</p></td></tr><tr><td valign="bottom" width="73"><p>6/14/2012</p></td><td valign="bottom" width="83"><p>15:35:20:05</p></td><td valign="bottom" width="62"><p>18.5</p></td><td valign="bottom" width="82"><p>65.29</p></td></tr><tr><td valign="bottom" width="73"><p>6/14/2012</p></td><td valign="bottom" width="83"><p>15:35:30:05</p></td><td valign="bottom" width="62"><p>18</p></td><td valign="bottom" width="82"><p>64.4</p></td></tr><tr><td valign="bottom" width="73"><p>6/14/2012</p></td><td valign="bottom" width="83"><p>15:35:40:05</p></td><td valign="bottom" width="62"><p>18</p></td><td valign="bottom" width="82"><p>64.4</p></td></tr><tr><td valign="bottom" width="73"><p>6/14/2012</p></td><td valign="bottom" width="83"><p>15:35:50:05</p></td><td valign="bottom" width="62"><p>18.75</p></td><td valign="bottom" width="82"><p>65.75</p></td></tr></tbody></table><p>&nbsp;</p><h5>Device Connections</h5><p>Instead of permanently soldering the temperature sensor to the prototyping area of the shield, <a href="http://www.sparkfun.com/search/results?term=F%2FF&amp;what=products">female / female jumper wires</a> were used to make connections between the shield's own pin headers as well as the thermocouple's male pin headers.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/LoggerShieldBoard3.png"><img title="LoggerShieldBoard" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/LoggerShieldBoard_thumb.png" alt="LoggerShieldBoard" width="640" height="434" border="0"></a></p><p>The following table enumerates these connections:</p><table width="515" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td valign="top" width="243"><p><strong>Shield Pin</strong></p></td><td valign="top" width="270"><p><strong>Destination Pin</strong></p></td></tr><tr><td valign="top" width="244"><p>3v (Power header)</p></td><td valign="top" width="270"><p>Max6675 VCC</p></td></tr><tr><td valign="top" width="244"><p>GND (Power or Digital I/O header)</p></td><td valign="top" width="270"><p>Max6675 GND</p></td></tr><tr><td valign="top" width="244"><p>D13 (Digital I/O header, SPI CLK)</p></td><td valign="top" width="270"><p>Max6675 CLK (SPI CLK)</p></td></tr><tr><td valign="top" width="244"><p>D12 (Digital I/O header, SPI MISO)</p></td><td valign="top" width="270"><p>Max6675 DO (SPI MISO)</p></td></tr><tr><td valign="top" width="244"><p>D2 (Digital I/O header, used as SPI /SS)</p></td><td valign="top" width="270"><p>Max6675 CS (SPI /SS)</p></td></tr><tr><td valign="top" width="244"><p>L1 (LEDS header)</p></td><td valign="top" width="270"><p>D1 (Digital I/O header)</p></td></tr><tr><td valign="top" width="244"><p>L2 (LEDS header)</p></td><td valign="top" width="270"><p>D0 (Digital I/O header)</p></td></tr><tr><td valign="top" width="244"><p>CD (SD card detect)</p></td><td valign="top" width="270"><p>D3 (Digital I/O header)</p></td></tr></tbody></table><h5>&nbsp;</h5><h5>Reading temperature using an Adafruit Max6675 Thermocouple amplifier breakout board</h5><p>The <a href="http://datasheets.maxim-ic.com/en/ds/MAX6675.pdf">Max6675 thermocouple amplifier chip</a> on the breakout board is a read-only SPI device. When the CS pin (SPI /SS) of the device is asserted with a 1ms delay before reading, the chip returns a 12-bit value on its DO pin (SPI MISO) corresponding to the temperature measured by a <a href="http://en.wikipedia.org/wiki/Thermocouple">K-type Thermocouple</a> wire. The resulting <a href="http://netduinohelpers.codeplex.com/SourceControl/list/changesets">C# driver for the Max6675</a> is short:</p><p><pre class="brush: csharp">
using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

namespace Maxim.Temperature{
    public class Max6675 : IDisposable {
        protected SPI Spi;

        public void Initialize(Cpu.Pin chipSelect) {
            Spi = new SPI(
            new SPI.Configuration(
            chipSelect, false, 1, 0, false, true, 2000, SPI.SPI_module.SPI1)
            );
        }

        public double Celsius {
            get { return RawSensorValue * 0.25; }
        }

        public double Farenheit {
            get { return ((Celsius * 9.0) / 5.0) &#43; 32; }
        }

        protected UInt16 RawSensorValue;
        protected byte[] ReadBuffer = new byte[2];
        protected byte[] WriteBuffer = new byte[2];

        public void Read() {
            RawSensorValue = 0;
            Spi.WriteRead(WriteBuffer, ReadBuffer);
            RawSensorValue |= ReadBuffer[0];
            RawSensorValue &lt;&lt;= 8;
            RawSensorValue |= ReadBuffer[1];

            if ((RawSensorValue &amp; 0x4) == 1) {
                throw new ApplicationException(&quot;No thermocouple attached.&quot;);
            }

            RawSensorValue &gt;&gt;= 3;
        }

        public void Dispose() {
            Spi.Dispose();
        }

        ~Max6675() {
            Dispose();
        }
    }
}
</pre></p><h5>Temperature logger application walkthrough</h5><p>Let's review the key parts of the <a href="http://netduinohelpers.codeplex.com/SourceControl/list/changesets">temperature logging application code</a> and how it interacts with the devices connected to the shield.</p><p><pre class="brush: csharp">
public static readonly string SdMountPoint = &quot;SD&quot;;
</pre></p><p>Defines an arbitrary string used to refer to the SD card when using StorageDevice.MountSD and StorageDevice.Unmount functions.</p><p><pre class="brush: csharp">
public static readonly int TemperatureLoggerPeriod = 10 * 1000; // milliseconds
</pre></p><p>Defines the interval between temperature samples.</p><p><pre class="brush: csharp">
public static OutputPort LedRed = new OutputPort(Pins.GPIO_PIN_D0, false);
</pre></p><p>Defines an output connected to pin D0 controlling the state of the red LED on the shield.</p><p><pre class="brush: csharp">
public static OutputPort LedGreen = new OutputPort(Pins.GPIO_PIN_D1, false);
</pre></p><p>Defines an output connected to pin D1 controlling the state of the green LED on the shield.</p><p><pre class="brush: csharp">
public static InputPort CardDetect = new InputPort(
    Pins.GPIO_PIN_D3,
    true,
    Port.ResistorMode.PullUp);
</pre></p><p>Defines an input connected to pin D3 used to determine if an SD card is inserted in the SD socket.</p><p><pre class="brush: csharp">
public static ManualResetEvent ResetPeripherals = new ManualResetEvent(false);
</pre></p><p>Defines a manual reset event object that will be used in the main application loop to determine when to re-initialize the shield's peripherals.</p><p><pre class="brush: csharp">
public static readonly Cpu.Pin ThermoCoupleChipSelect = Pins.GPIO_PIN_D2;
</pre></p><p>Defines D2 as the SPI chip select pin connected to the Max6675 Thermocouple board.</p><p><pre class="brush: csharp">
public static Timer TemperatureSampler;
</pre></p><p>Defines an instance of a timer object which will drive temperature sampling.</p><p><pre class="brush: csharp">
public static DS1307 Clock;
</pre></p><p>Defines an instance of the DS1307 real time clock driver.</p><p><pre class="brush: csharp">
public static Max6675 ThermoCouple;
</pre></p><p>Defines an instance of the Max6675 thermocouple driver.</p><p><pre class="brush: csharp">
public static ArrayList Buffer = new ArrayList();
</pre></p><p>Defines an array list instance which will be used as a temporary buffer when the SD card is removed from its socket.</p><p>The application's main loop is only concerned about the state of the peripherals:</p><ul><li>It initializes the devices connected to the shield </li><li>It waits indefinitely for a signal indicating that a hardware error occurred </li><li>It disposes of the current device instances and starts over </li></ul><p><pre class="brush: csharp">
public static void Main() {
    while (true) {
        InitializePeripherals();
        ResetPeripherals.WaitOne();
        ResetPeripherals.Reset();
        DeInitializePeripherals();
    }
}
</pre></p><p><strong>InitializePeripherals</strong> indicates that it is working by controlling the green LED on the shield. Its role is focused on object creation and initialization.</p><p><pre class="brush: csharp">
public static void InitializePeripherals() {
    LedGreen.Write(true);
    Clock = new DS1307();
    ThermoCouple = new Max6675();
    InitializeStorage(true);
    InitializeClock(new DateTime(2012, 06, 14, 17, 00, 00));
    ThermoCouple.Initialize(ThermoCoupleChipSelect);
    TemperatureSampler = new Timer(
    new TimerCallback(LogTemperature),
    null,
    250,
    TemperatureLoggerPeriod);
    LedGreen.Write(false);
}
</pre></p><p>If the initialization of a peripheral fails, the shield will quickly blink its LEDs, indefinitely:</p><p><pre class="brush: csharp">
public static void SignalCriticalError() {
    while (true) {
        LedRed.Write(true);
        LedGreen.Write(true);
        Thread.Sleep(100);
        LedRed.Write(false);
        LedGreen.Write(false);
        Thread.Sleep(100);
    }
}
</pre></p><p>The clock initialization function only sets the clock date and time when it is unable to find a file named 'clockSet.txt' on the SD card, ensuring that the initialization of the DS1307 only happens once in the <strong>InitializePeripherals</strong> function or until the file is deleted.</p><p><pre class="brush: csharp">
public static void InitializeClock(DateTime dateTime) {
    var clockSetIndicator = SdMountPoint &#43; @&quot;\clockSet.txt&quot;;

    try {
        if (File.Exists(clockSetIndicator) == false) {
            Clock.Set(dateTime);
            Clock.Halt(false);
            File.Create(clockSetIndicator);
        }
    } catch (Exception e) {
        LogLine(&quot;InitializeClock: &quot; &#43; e.Message);
        SignalCriticalError();
    }
}
</pre></p><p>The <strong>LogTemperature</strong> function is the callback invoked by the Timer object every 10 seconds. The function indicates that it is working by turning the red LED on the shield ON and OFF.</p><p><pre class="brush: csharp">
public static void LogTemperature(object obj) {
    LedRed.Write(true);
}
</pre></p><p>The function reads the current time from the clock with Clock.Get() and takes a temperature sample with ThermoCouple.Read().</p><p><pre class="brush: csharp">
var tickStart = Utility.GetMachineTime().Ticks;
var now = Clock.Get();
ThermoCouple.Read();
var elapsedMs = (int)((Utility.GetMachineTime().Ticks - tickStart) / TimeSpan.TicksPerMillisecond);
</pre></p><p>Then, it concatenates a string containing the date, time and temperature expressed in Celsius and Fahrenheit, with each field separated by commas.</p><p><pre class="brush: csharp">
var date = AddZeroPrefix(now.Year) &#43; &quot;/&quot; &#43; AddZeroPrefix(now.Month) &#43; &quot;/&quot; &#43; AddZeroPrefix(now.Day);
var time = AddZeroPrefix(now.Hour) &#43; &quot;:&quot; &#43; AddZeroPrefix(now.Minute) &#43; &quot;:&quot; &#43; AddZeroPrefix(now.Second) &#43; &quot;:&quot; &#43; AddZeroPrefix(elapsedMs);
var celsius = Shorten(ThermoCouple.Celsius.ToString());
var farenheit = Shorten(ThermoCouple.Farenheit.ToString());
var latestRecord = date &#43; &quot;,&quot; &#43; time &#43; &quot;,&quot; &#43; celsius &#43; &quot;,&quot; &#43; farenheit;
</pre></p><p>To make the data more manageable, daily temperature files are created as needed, each one starting with the column headers expected for parsing the values in CSV format.</p><p><pre class="brush: csharp">
var filename = SdMountPoint &#43; BuildTemperatureLogFilename(now);
if (File.Exists(filename) == false) {
    using (var tempLogFile = new StreamWriter(filename, true)) {
        tempLogFile.WriteLine(&quot;date,time,celsius,fahrenheit&quot;);
    }
}
</pre></p><p>The temperature sampling application lets the user remove the SD card from its socket so that the CSV files can be moved over to a PC for processing without losing data in the meantime. In order to do this, the application checks the state of the 'Card Detect' pin before attempting file system I/Os.</p><p>When the SD card is not present, the latest temperature record is preserved in the array list buffer until the SD card is put back in its socket. The array list data is then flushed to storage.</p><p><pre class="brush: csharp">
if (CardDetect.Read() == false) {
    using (var tempLogFile = new StreamWriter(filename, true)) {
        if (Buffer.Count != 0) {
            foreach (var bufferedLine in Buffer) {
                tempLogFile.WriteLine(bufferedLine);
            }
            Buffer.Clear();
        }
        tempLogFile.WriteLine(latestRecord);
        tempLogFile.Flush();
    }
} else {
    LogLine(&quot;No card in reader. Buffering record.&quot;);
    Buffer.Add(latestRecord);
}
</pre></p><p>The temperature logging function expects to run out of memory if the array list buffer grows too large, in which case, all the records get purged. Other memory management strategies could be used to mitigate data loss in this case. However, this depends entirely on the requirements of the data logging application and is out of scope for this discussion.</p><p><pre class="brush: csharp">
catch (OutOfMemoryException e) {
    LogLine(&quot;Memory full. Clearing buffer.&quot;);
    Buffer.Clear();
}
</pre></p><p>The temperature logging function also handles file system exceptions caused by the removal of the SD card and reacts by signaling the <strong>ResetPeripherals</strong> event. In turn, this lets the application's main loop know that the peripherals, and most specifically the SD card, need to be recycled and initialized again in order to recover from the error.</p><p><pre class="brush: csharp">
catch (IOException e) {
    LogLine(&quot;IO error. Resetting peripherals.&quot;);
    Buffer.Add(latestRecord);
    ResetPeripherals.Set();
}
</pre></p><h5>Conclusion</h5><p>In this article, we took a shield designed for the Arduino and learned how to critically review the Arduino code libraries supporting it, drawing parallels with features offered by the .NET Micro Framework. This process allowed us to identify areas in the Arduino code which were not necessary to port over to C# such as SD card and file system handlers. It also allowed us to see the similarities in the way the Arduino and the Netduino handle I2C communications.</p><p>Most importantly, we also learned the importance of reviewing a device's schematics and component datasheets to ensure that important features have not been omitted and potentially incorrectly implemented when considering using an unknown library: in the case of RTClib, we saw that the implementation was limited to the basic date and time functions of the DS1307, leaving out other useful features such as the clock's built-in RAM and the square wave generation functions.</p><p>In our next article, we'll take on a much more complex shield and we will learn how to analyze Arduino libraries in depth before porting them from C/C&#43;&#43; to C#.</p><h6>Bio</h6><p>Fabien is the Chief Hacker and co-founder of Nwazet, a start-up company located in Redmond WA, specializing in Open Source software and embedded hardware design. Fabien's passion for technology started 30 years ago, creating video games for fun and for profit. He went on working on mainframes, industrial manufacturing systems, mobile and web applications. Before Nwazet, Fabien worked at MSFT for eight years in Windows Core Security, Windows Core Networking and Xbox. During downtime, Fabien enjoys shooting zombies and watching sci-fi.</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:21e6180e991b4430b459a0b00157f766">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Using-the-Adafruit-Arduino-Logger-Shield-on-a-Netduino</comments>
      <itunes:summary>C9 Netduino Shield Series - Using Arduino Shields with a Netduino - Part II IntroductionIn our previous article, we examined what an Arduino shield is, how to build a simple custom shield and discussed how to quickly identify shields that are good candidates for a Netduino adaptation versus shields that may not be. In this article, we’ll take a popular Arduino Logger Shield produced by Adafruit and we’ll interface it with a Netduino / Plus microcontroller  The Arduino Logger Shield is an excellent one to start with because it offers immediate benefits to a Netduino / Plus user: Time-keeping SD card storage Two user-controllable LEDs A small prototyping area An onboard 3.3v voltage regulator for clean analog readings and power decoupling In our C# data logging application, we&#39;ll interact with the time keeper, the SD card storage and its &#39;card detect&#39; pin, the two LEDs as well as a temperature sensor (not included with the shield). Before diving into the details associated with the hardware, you may want to take a look at the C# objects representing the hardware: 
public static readonly string SdMountPoint = &amp;quot;SD&amp;quot;;
public static OutputPort LedRed = new OutputPort(Pins.GPIO_PIN_D0, false);
public static OutputPort LedGreen = new OutputPort(Pins.GPIO_PIN_D1, false);
public static InputPort CardDetect = new InputPort(Pins.GPIO_PIN_D3, true, Port.ResistorMode.PullUp);
public static readonly Cpu.Pin ThermoCoupleChipSelect = Pins.GPIO_PIN_D2;
public static DS1307 Clock;
public static Max6675 ThermoCouple;
 and their initialization: 
public static void InitializePeripherals() {
    LedGreen.Write(true);
    Clock = new DS1307();
    ThermoCouple = new Max6675();
    InitializeStorage(true);
    InitializeClock(new DateTime(2012, 06, 14, 17, 00, 00));
    ThermoCouple.Initialize(ThermoCoupleChipSelect);
    TemperatureSampler = new Timer(new TimerCallback(LogTemperature), null, 250, TemperatureLoggerPeriod);
    LedGreen.Write(false);
}
 The SD car</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/Using-the-Adafruit-Arduino-Logger-Shield-on-a-Netduino</link>
      <pubDate>Thu, 23 Aug 2012 17:30:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Using-the-Adafruit-Arduino-Logger-Shield-on-a-Netduino</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/fa8f6217-ff20-4c2e-aa7a-ad2a9863a393.png" height="100" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/cfee8783-651c-4d70-a424-095683cef757.png" height="220" width="220"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/bbbe9892-676d-4b3e-b08b-f29ae87996c5.png" height="288" width="512"></media:thumbnail>      
      <dc:creator>Fabien Royer</dc:creator>
      <itunes:author>Fabien Royer</itunes:author>
      <slash:comments>3</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/Using-the-Adafruit-Arduino-Logger-Shield-on-a-Netduino/RSS</wfw:commentRss>
      <category>.NET Micro Framework</category>
      <category>Hardware</category>
    </item>
  <item>
      <title>Hardware accelerating everything: Windows 8 graphics</title>
      <description><![CDATA[<p>In computer graphics, high performance is a guiding principle. In Windows 8, we knew we wanted to create a new, visually rich way for users to interact with apps and with Windows itself. We&nbsp;knew that we'd be building a new platform for creating apps, and that we'd be targeting a more diverse set of hardware than ever before. For more details read the blog post on Hardware accelerating everything: Windows 8 graphics. <a href="http://blogs.msdn.com/b/b8/archive/2012/07/23/hardware-accelerating-everything-windows-8-graphics.aspx">http://blogs.msdn.com/b/b8/archive/2012/07/23/hardware-accelerating-everything-windows-8-graphics.aspx</a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:f86dd9315c9d4a68888da077015ab519">]]></description>
      <comments>http://channel9.msdn.com/posts/Hardware-accelerating-everything-Windows-8-graphics</comments>
      <itunes:summary>In computer graphics, high performance is a guiding principle. In Windows 8, we knew we wanted to create a new, visually rich way for users to interact with apps and with Windows itself. We&amp;nbsp;knew that we&#39;d be building a new platform for creating apps, and that we&#39;d be targeting a more diverse set of hardware than ever before. For more details read the blog post on Hardware accelerating everything: Windows 8 graphics. http://blogs.msdn.com/b/b8/archive/2012/07/23/hardware-accelerating-everything-windows-8-graphics.aspx </itunes:summary>
      <itunes:duration>192</itunes:duration>
      <link>http://channel9.msdn.com/posts/Hardware-accelerating-everything-Windows-8-graphics</link>
      <pubDate>Fri, 03 Aug 2012 23:18:25 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/posts/Hardware-accelerating-everything-Windows-8-graphics</guid>
      <media:thumbnail url="http://media.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics_100.jpg" height="56" width="100"></media:thumbnail>
      <media:thumbnail url="http://media.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics_220.jpg" height="123" width="220"></media:thumbnail>
      <media:thumbnail url="http://media.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics_512.jpg" height="288" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://media.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics.mp3" expression="full" duration="192" fileSize="3075947" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://media.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics.mp4" expression="full" duration="192" fileSize="18747485" type="video/mp4" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics.webm" expression="full" duration="192" fileSize="7207024" type="video/webm" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics.wma" expression="full" duration="192" fileSize="1561103" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://media.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics.wmv" expression="full" duration="192" fileSize="23846637" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics_high.mp4" expression="full" duration="192" fileSize="40714639" type="video/mp4" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics_mid.mp4" expression="full" duration="192" fileSize="28613869" type="video/mp4" medium="video"></media:content>
        <media:content url="http://media.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics_Source.wmv" expression="full" duration="192" fileSize="73054712" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://smooth.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics.ism/manifest" expression="full" duration="192" fileSize="8846" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://media.ch9.ms/ch9/fbfa/2dbd096d-24f0-46ce-8777-acf65beffbfa/HardwareAcceleratingEverythingGraphics.wmv" length="23846637" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Roxanne Beaver</dc:creator>
      <itunes:author>Roxanne Beaver</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/posts/Hardware-accelerating-everything-Windows-8-graphics/rss</wfw:commentRss>
      <category>Accelerators</category>
      <category>Graphics</category>
      <category>Hardware</category>
      <category>Windows 8</category>
    </item>
  <item>
      <title>Design and simulate digital logic circuits with LogicCircuit</title>
      <description><![CDATA[<p>Today's Hardware Friday post isn't about hardware...directly. What if you'd just like to play around creating logic circuits? Or maybe use a program to help you learn how to design them? Oh yeah, and where the source for that program was available too?</p><h2><a href="http://logiccircuit.codeplex.com/" target="_blank">LogicCircuit</a></h2><blockquote><h4>Description</h4><p>LogicCircuit – is educational software for designing and simulating digital logic circuits.<br>Intuitive graphical user interface, allows you to create unrestricted circuit hierarchy with multi bit buses, debug circuits behavior with oscilloscope, and navigate running circuits hierarchy.</p><p>Official Web site</p><p>The official web site was created. Please visit it at: <a href="http://www.LogicCircuit.org">http://www.LogicCircuit.org</a></p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B2%5D-50.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb-49.png" alt="image" width="417" height="407" border="0"></a></p></blockquote><p>How does it work? How do you create your own?</p><blockquote><h4>Short user guide</h4><p>There are two modes the program can be in: edit mode and running mode. To switch use power button on the status bar, checkbox on the sliding tool panel on the bottom or use short cut: Ctrl&#43;W.</p><p>In edit mode on the left side you can see all available circuits. Just drag and drop them where you want on the diagram – right part of the window. In order to wire circuits just click connector – bold dot on the side of the circuits and then click where you want your wire be extended to. Wires are connected only if their ends are in the same location. If you just cross two wires they are not connected.</p><p>By double clicking items on the diagram you can start editing them. So double click on pin, constant, memory, or button will open dialog where you can change properties of the item. Double click symbol of logical circuit you’ve created will switch you to this circuit. To change properties of the entire project select menu Circuit/Project, to change properties of the currently edited logical circuit either double click anywhere in empty space on the diagram or select menu Circuit/Logical Circuit.</p><p>In order to select an item on diagram, just click it. To add an item to selection or remove it from - hold Ctrl and click. Press and move mouse you can select everything in marked area. Hold Shift and click wire to select entire conductor. Ctrl&#43;A will select everything on the diagram. Edit menu contains some other useful commands to select and unselect symbols on the circuit diagram.</p><p>When you create a new circuit it becomes available for you to use on other circuits.</p><ul><li>Use input and output pins as interface with external circuits. </li><li>Use probes to observe state of the circuits when it is in running mode. </li></ul><p>When in running mode you can interact with you circuits through buttons and double clicking constants – which increment value of constant within it bit width.<br>If you have some probes connected on your circuits you can open oscilloscope and watch history of the states of your probes.</p><p>To switch between your circuits you can double click them on the left panel or pressing Ctrl &#43; Tab or Ctrl &#43; Shift &#43; Tab to navigate through circuits in reverse historical order. Press Tab more than once while holding Ctrl to navigate further in the history.</p><p>Happy designing!</p></blockquote><p><a href="http://www.LogicCircuit.org/">Logic Circuit</a> - <a href="http://www.logiccircuit.org/edit.html" target="_blank">Editing circuits</a></p><blockquote><p>When you first open LogicCircuit it will be one empty logical circuit visible on the right pane of the program window named &quot;Main&quot;.</p><p><a href="http://www.logiccircuit.org/edit.html" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B6%5D-39.png" alt="image" width="55" height="407" border="0"></a></p></blockquote><p>Following the above getting started guides, I had my first circuit running in seconds.</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/SNAGHTML52fc0966%5B3%5D.png" target="_blank"><img title="SNAGHTML52fc0966" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/SNAGHTML52fc0966_thumb.png" alt="SNAGHTML52fc0966" width="650" height="367" border="0"></a></p><p>What can you build with?</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B34%5D-7.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B13%5D-8.png" alt="image" width="310" height="427" border="0"></a><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B32%5D-4.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B11%5D-11.png" alt="image" width="295" height="427" border="0"></a><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B33%5D-3.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B12%5D-8.png" alt="image" width="350" height="380" border="0"></a></p><p>I mentioned the source was available? Yep! And the latest check-in ran for me the first time... Here's a snap of the Solution.</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B13%5D-17.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B4%5D-37.png" alt="image" width="200" height="427" border="0"></a></p><p>That's right, you get all the source behind this cool tool.</p><p>If you want to play with building circuits but soldering iron phobia, want to quickly play with some design ideas or are looking for some really interesting code to spelunk, LogicCircuit is a project that's under active development and just a download away...</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:93b02c758a804dfeb3d8a05d01560727">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/Design-and-simulate-digital-logic-circuits-with-LogicCircuit</comments>
      <itunes:summary>Today&#39;s Hardware Friday post isn&#39;t about hardware...directly. What if you&#39;d just like to play around creating logic circuits? Or maybe use a program to help you learn how to design them? Oh yeah, and where the source for that program was available too? LogicCircuitDescriptionLogicCircuit – is educational software for designing and simulating digital logic circuits.Intuitive graphical user interface, allows you to create unrestricted circuit hierarchy with multi bit buses, debug circuits behavior with oscilloscope, and navigate running circuits hierarchy. Official Web site The official web site was created. Please visit it at: http://www.LogicCircuit.org  How does it work? How do you create your own? Short user guideThere are two modes the program can be in: edit mode and running mode. To switch use power button on the status bar, checkbox on the sliding tool panel on the bottom or use short cut: Ctrl&amp;#43;W. In edit mode on the left side you can see all available circuits. Just drag and drop them where you want on the diagram – right part of the window. In order to wire circuits just click connector – bold dot on the side of the circuits and then click where you want your wire be extended to. Wires are connected only if their ends are in the same location. If you just cross two wires they are not connected. By double clicking items on the diagram you can start editing them. So double click on pin, constant, memory, or button will open dialog where you can change properties of the item. Double click symbol of logical circuit you’ve created will switch you to this circuit. To change properties of the entire project select menu Circuit/Project, to change properties of the currently edited logical circuit either double click anywhere in empty space on the diagram or select menu Circuit/Logical Circuit. In order to select an item on diagram, just click it. To add an item to selection or remove it from - hold Ctrl and click. Press and move mouse you can select everything i</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/Design-and-simulate-digital-logic-circuits-with-LogicCircuit</link>
      <pubDate>Fri, 01 Jun 2012 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/Design-and-simulate-digital-logic-circuits-with-LogicCircuit</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/2629eec6-6e3e-405d-89d3-a95d1f0410ac.png" height="100" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/78cc11c9-6e03-4812-b301-0bb6553aa315.png" height="220" width="220"></media:thumbnail>      
      <dc:creator>Greg Duncan</dc:creator>
      <itunes:author>Greg Duncan</itunes:author>
      <slash:comments>5</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/Design-and-simulate-digital-logic-circuits-with-LogicCircuit/RSS</wfw:commentRss>
      <category>C#</category>
      <category>Coding4Fun</category>
      <category>Hardware</category>
    </item>
  <item>
      <title>Mom always said, &quot;Sit up straight...&quot; Well, here&#39;s a hardware project to help with that...</title>
      <description><![CDATA[<p>Today's Hardware Friday post shows off an interesting usage of an accelerometer and one that for many of use would not only proudly display our hardware building geekness, but also improve our health too!</p><h2><a href="http://mikedodaro.net/2012/03/09/posture-regulator-using-net-gadgeteer-accelerometer-from-seeed-studio/" target="_blank">Posture Regulator using .NET Gadgeteer Accelerometer from Seeed Studio</a></h2><blockquote><p>People who work in technology often spend many hours at the computer, which can make it difficult to maintain good posture. I’ve been advised by a physical therapist to keep my chest high with my head and neck upright. The problem is that fatigue tends to make me slouch. Then my neck is out of alignment, leading to some unpleasant grinding of vertibrae and tension in the shoulders.</p><p>The <strong>.NET Gadgeteer</strong> device in this example uses the <a href="http://www.seeedstudio.com/depot/accelerometer-module-net-gadgeteer-compatible-p-968.html?cPath=203">Seeed accelerometer module</a>, which can be calibrated with a single function to set the base position that should be maintained. I use a <a href="http://www.seeedstudio.com/depot/relay-module-net-gadgeteer-compatible-p-967.html?cPath=203">relay module</a>, also from Seeed Studio, to activate a beeper when the Z axis of my posture varies too far from the calibrated normal.</p><p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/1Ib91L_yMo0&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/1Ib91L_yMo0&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p><p>The accelerometer is similar to the sensor in a cell phone that detects whether the phone is in the horizontal or vertical orientation. The methods that the <strong>Seeed</strong> module supports are more than adequate for this application. There is a method to calibrate the position from which variation is measured. Monitoring the Z axis of the variation is sufficient to detect the kind of slouching I’m trying to avoid. For this prototype I simply attached the accelerometer to my sweater with a safety pin, as shown in the following photo.</p><p><a href="http://mikedodaro.net/2012/03/09/posture-regulator-using-net-gadgeteer-accelerometer-from-seeed-studio/" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B7%5D-15.png" alt="image" width="250" height="384" border="0"></a></p><p><a href="http://mikedodaro.net/2012/03/09/posture-regulator-using-net-gadgeteer-accelerometer-from-seeed-studio/" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B6%5D-33.png" alt="image" width="409" height="407" border="0"></a></p><p><a href="http://mikedodaro.net/2012/03/09/posture-regulator-using-net-gadgeteer-accelerometer-from-seeed-studio/" target="_blank"><img title="SNAGHTML28a02ee1" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/SNAGHTML28a02ee1%5B4%5D.png" alt="SNAGHTML28a02ee1" width="557" height="407" border="0"></a></p></blockquote><h2><a href="http://mikedodaro.net/2012/03/10/posture-regulator-with-led-alert-silent/" target="_blank">Posture Regulator with LED Alert – Silent</a></h2><blockquote><p>This is a second iteration on the device using a<a href="http://www.seeedstudio.com/depot/accelerometer-module-net-gadgeteer-compatible-p-968.html?cPath=203"> Seeed accelerometer </a>as posture sensor that sends alerts when the user’s posture lapses from the position desirable for working extended periods in the seated position. The <a href="http://wp.me/p1TEdE-hU">previous version </a>used a buzzer on a relay circuit as an alert. It produced a sound that could drive one to distraction. This version uses a LED that simply turns red when the user wearing the accelerometer slouches or leans too far from the desirable vertical position.</p><p>The modules used in this application are shown in the following screen shot from the <a href="http://wp.me/p1TEdE-1c">.NET Gadgeteer Designer</a>.</p><p><a href="http://mikedodaro.net/2012/03/10/posture-regulator-with-led-alert-silent/" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B11%5D-22.png" alt="image" width="498" height="407" border="0"></a></p><p>Posture Accelerometer Sensor LED Alert</p><p>This implementation of the posture sensor is different from the previous version in that it doesn’t require a relay circuit to turn on a buzzer. It uses the <a href="http://www.ghielectronics.com/catalog/product/272">GHI Electronics multicolored LED module</a>. It also uses the <a href="http://www.seeedstudio.com/depot/oled-display-module-net-gadgeteer-compatible-p-1019.html?cPath=203">Seeed OLED Display module </a>instead of the larger and more expensive <a href="http://www.ghielectronics.com/catalog/product/276">Display T35 </a>from GHI Electronics.</p><p>The application logic is similar in this version to the previous except that it omits the relay circuit and turns on the LED instead of the buzzer. The following illustration shows the working components.</p><p><a href="http://mikedodaro.net/2012/03/10/posture-regulator-with-led-alert-silent/" target="_blank"><img title="SNAGHTML28a2933f" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/SNAGHTML28a2933f%5B4%5D.png" alt="SNAGHTML28a2933f" width="494" height="407" border="0"></a></p><p>...</p><p>One surprising discovery in this version is that the <strong>Accelerometer.StartContinuousMeasurements </strong>method has to be set at a lower frequency than the previous version. Having the relay running on the board changed the configuration so that the button could interupt the continuous measurements and turn off the measurements. In this version I found that pushing the on/ off button had no effect until I slowed the rate of continuous measurements.</p></blockquote><p>Come on, what hardware hacker wouldn't want to wear something like that? Now to make it portable, and report posture results to a web site (and tweet them?), maybe some Bluetooth integration to an app, and... and... and...</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:94f916eded0e46afa7eea02b010f907a">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/Mom-always-said-Sit-up-straight-Well-heres-a-hardware-project-to-help-with-that</comments>
      <itunes:summary>Today&#39;s Hardware Friday post shows off an interesting usage of an accelerometer and one that for many of use would not only proudly display our hardware building geekness, but also improve our health too! Posture Regulator using .NET Gadgeteer Accelerometer from Seeed StudioPeople who work in technology often spend many hours at the computer, which can make it difficult to maintain good posture. I’ve been advised by a physical therapist to keep my chest high with my head and neck upright. The problem is that fatigue tends to make me slouch. Then my neck is out of alignment, leading to some unpleasant grinding of vertibrae and tension in the shoulders. The .NET Gadgeteer device in this example uses the Seeed accelerometer module, which can be calibrated with a single function to set the base position that should be maintained. I use a relay module, also from Seeed Studio, to activate a beeper when the Z axis of my posture varies too far from the calibrated normal.  The accelerometer is similar to the sensor in a cell phone that detects whether the phone is in the horizontal or vertical orientation. The methods that the Seeed module supports are more than adequate for this application. There is a method to calibrate the position from which variation is measured. Monitoring the Z axis of the variation is sufficient to detect the kind of slouching I’m trying to avoid. For this prototype I simply attached the accelerometer to my sweater with a safety pin, as shown in the following photo.    Posture Regulator with LED Alert – SilentThis is a second iteration on the device using a Seeed accelerometer as posture sensor that sends alerts when the user’s posture lapses from the position desirable for working extended periods in the seated position. The previous version used a buzzer on a relay circuit as an alert. It produced a sound that could drive one to distraction. This version uses a LED that simply turns red when the user wearing the accelerometer slouches or leans too</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/Mom-always-said-Sit-up-straight-Well-heres-a-hardware-project-to-help-with-that</link>
      <pubDate>Fri, 13 Apr 2012 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/Mom-always-said-Sit-up-straight-Well-heres-a-hardware-project-to-help-with-that</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/e1f440fb-23fe-40c3-a39f-cc8c31a3b62e.png" height="85" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/2cc0eb21-cd67-4940-87c8-a3256f8447bb.png" height="186" width="220"></media:thumbnail>      
      <dc:creator>Greg Duncan</dc:creator>
      <itunes:author>Greg Duncan</itunes:author>
      <slash:comments>5</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/Mom-always-said-Sit-up-straight-Well-heres-a-hardware-project-to-help-with-that/RSS</wfw:commentRss>
      <category>.NET Micro Framework</category>
      <category>C#</category>
      <category>Coding4Fun</category>
      <category>Hardware</category>
      <category>.Net Gadgeteer</category>
    </item>
  <item>
      <title>Project Detroit: How to Read Your Car’s Engine Data with OBD-II</title>
      <description><![CDATA[<p>In this article we will look at the OBD-II sub-system and instrument cluster application of the Project Detroit Mustang we built with West Coast Customs.&nbsp; If you're not familiar with this project, you can find out more about it <a href="http://channel9.msdn.com/coding4fun/detroit">here</a> and <a href="http://channel9.msdn.com/Blogs/Vector/The-400-horsepower-device">here</a>.</p><h2>OBD-II</h2><p>OBD stands for On-Board Diagnostics.&nbsp; In the world of cars, this can be thought of as the computer which has a variety of data points which can be queried, such as speed, fuel level, and even trouble codes that relate to the check engine light.&nbsp; If you've ever taken your car in for service, your service center has hooked up the car to a computer via the OBD port to get the status of the car and what may not be working properly.</p><h2>Getting Started</h2><p>To use the OBD library with your vehicle, first you need an OBD to USB or serial cable.&nbsp; These can be found in numerous places, but we recommend <a href="http://www.scantool.net/scan-tools/pc-based/obdlink-sx.html">this cable from ScanTool.net</a>, which was used with the <a href="http://channel9.msdn.com/coding4fun/detroit">Project Detroit</a> car and our software.&nbsp; Here's how to get connected:</p><ol><li>With the car off, plug the OBD end into your vehicle.&nbsp; The port is in a different location in every vehicle, but it's guaranteed to be somewhere near the driver's location. <a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_05456.jpg"><img title="IMG_0545" border="0" alt="IMG_0545" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/IMG_0545_thumb3.jpg" width="444" height="219"></a> </li><li>Plug the USB/serial end of the cable into your computer and note which COM port the cable is connected to. </li><li>Update the <strong>app.config</strong> file of the <strong>InstrumentCluster</strong> project with that COM port. </li><li>Start the car. </li><li>Run the <strong>InstrumentCluster</strong> application, and data should start flowing. </li></ol><h2>Calling the OBD library programmatically</h2><ul><li>Create an instance of the <strong>ObdDevice</strong> class </li><li>Call the <strong>Connect</strong> method with the appropriate COM port, baud rate, and, if known, OBD protocol </li><li>From here, the library works in two ways: automatic polling or manual polling <ul><li><strong>Automatic</strong> – Pass <strong>true</strong> to the <strong>Connect</strong> method. This will poll the OBD as quickly as it can requesting RPM, MPH, MPG, Fuel Level and Engine Coolant Temperature. Note that not all vehicles will support all of these. In this mode, hook the <strong>ObdChanged</strong> event to receive an <strong>ObdState</strong> packet with the new data. </li><li><strong>Manual</strong> – Pass <strong>false</strong> to the <strong>Connect</strong> method. Then, create your own thread and call the <strong>ObdDevice</strong>'s Get methods to retrieve the data you want as quickly as you want it.&nbsp; This is the way we used the library in Project Detroit.&nbsp; We polled manually, collecting the speed, RPM, and other critical data as quickly as possible, while only reading things like fuel level every few seconds. </li></ul></li></ul><p><br>OBD is a polled system, so data can only be returned as quickly as the time it takes to request it and return it. In short, only retrieve what you need when you need it.</p><p><pre class="brush: csharp">
ObdDevice obd;

obd = new ObdDevice();
obd.ObdChanged &#43;= _obd_ObdChanged;

// com port, baud rate, protocol (if known), automatic polling
obd.Connect(&quot;COM1&quot;, 115200, ObdDevice.UnknownProtocol, true);

...

void obd_ObdChanged(object sender, ObdChangedEventArgs e)
{
    e.ObdState.ToString();
}
</pre></p><h2>Customizing the Instrument Cluster</h2><p>The Instrument Cluster application is a WPF application that has 3 different skins which can be viewed by swiping left or right in the application, either with a finger, or the mouse.&nbsp; This is a simplified version of the actual application we used in the Project Detroit car, modified to talk straight to the OBD port instead of our intermediate WCF service.&nbsp; Please note that this isn't a robust, drop-in replacement application for a car dashboard, but only a sample of how the OBD library can be used.</p><p>Internally, the application uses the OBD library and hooks the <strong>ObdChanged</strong> event.&nbsp; The <strong>ObdChanged</strong> event returns a minimal amount of important data.&nbsp; When the event fires, the the <strong>SetInstrumentClusterValues</strong> method is run, which sets the OBD values to each gauge in whichever skin is currently visible.</p><p><pre class="brush: csharp">
private void SetInstrumentClusterValues(ObdState measurement)
{
    foreach (var item in _skins)
    {
        if(!item.IsVisible)
            continue;
        item.IsMalfunctionVisible = measurement.MilLightOn;
        item.IsLowFuelVisible = item.Fuel &lt; 10;
        item.MPG = measurement.MilesPerGallon;
        item.MPH = measurement.MilesPerHour;
        item.RPM = measurement.Rpm;
        item.Fuel = measurement.FuelLevel;
        item.Temperature = measurement.EngineCoolantTemperature;
    }
}
</pre></p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/Download3.png"><img title="Download" border="0" alt="Download" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/Download_thumb1.png" width="644" height="364"></a></p><h2>More Information</h2><ul><li><a href="http://channel9.msdn.com/coding4fun/detroit">Project Detroit</a> </li><li><a href="http://en.wikipedia.org/wiki/OBD-II#OBD-II">More information on OBD-II</a> </li><li><a href="http://elmelectronics.com/DSheets/ELM327DS.pdf">ELM323/327 Datasheet</a> </li><li><a href="http://www.scantool.net/scan-tools/pc-based/obdlink-sx.html">OBD-II to USB cable</a> </li></ul><h2>Known Issues / Limitations</h2><ul><li>This is known to work with cables that uses the ELM323/327 chipset. The specific cable that was used to develop this library is available from <a href="http://www.scantool.net/scan-tools/pc-based/obdlink-sx.html">ScanTool.net</a>, however other ELM323/327 OBD-II to USB cables should work. </li><li>There are a variety of different <a href="http://en.wikipedia.org/wiki/On-board_diagnostics#OBD-II_Signal_Protocols">OBD-II signal protocols</a>. This library only supports a few of them. If your car's OBD protocol is not supported, please feel free to add it and send us the changes to integrate back into the library! </li><li>If the vehicle has multiple ECUs, the ECU with the most PIDs is used. The other ECUs are ignored. </li><li>Not every standard PID is supported. </li><li>No custom manufacturer/model-specific PIDs are supported. </li></ul> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:f307abe7cf074cacb336a02e012fba25">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Project-Detroit-How-to-Read-Your-Cars-Engine-Data-with-OBD-II</comments>
      <itunes:summary>In this article we will look at the OBD-II sub-system and instrument cluster application of the Project Detroit Mustang we built with West Coast Customs.&amp;nbsp; If you&#39;re not familiar with this project, you can find out more about it here and here. OBD-IIOBD stands for On-Board Diagnostics.&amp;nbsp; In the world of cars, this can be thought of as the computer which has a variety of data points which can be queried, such as speed, fuel level, and even trouble codes that relate to the check engine light.&amp;nbsp; If you&#39;ve ever taken your car in for service, your service center has hooked up the car to a computer via the OBD port to get the status of the car and what may not be working properly. Getting StartedTo use the OBD library with your vehicle, first you need an OBD to USB or serial cable.&amp;nbsp; These can be found in numerous places, but we recommend this cable from ScanTool.net, which was used with the Project Detroit car and our software.&amp;nbsp; Here&#39;s how to get connected: With the car off, plug the OBD end into your vehicle.&amp;nbsp; The port is in a different location in every vehicle, but it&#39;s guaranteed to be somewhere near the driver&#39;s location.  Plug the USB/serial end of the cable into your computer and note which COM port the cable is connected to. Update the app.config file of the InstrumentCluster project with that COM port. Start the car. Run the InstrumentCluster application, and data should start flowing. Calling the OBD library programmaticallyCreate an instance of the ObdDevice class Call the Connect method with the appropriate COM port, baud rate, and, if known, OBD protocol From here, the library works in two ways: automatic polling or manual polling Automatic – Pass true to the Connect method. This will poll the OBD as quickly as it can requesting RPM, MPH, MPG, Fuel Level and Engine Coolant Temperature. Note that not all vehicles will support all of these. In this mode, hook the ObdChanged event to receive an ObdState packet with the new data. Manual</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/Project-Detroit-How-to-Read-Your-Cars-Engine-Data-with-OBD-II</link>
      <pubDate>Mon, 09 Apr 2012 19:24:20 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Project-Detroit-How-to-Read-Your-Cars-Engine-Data-with-OBD-II</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/22cf6572-42c8-47ed-a95b-1b8b2bbe200a.png" height="56" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/2a2ec08a-7d5d-458d-b1f6-fa8fb2ebce1d.png" height="124" width="220"></media:thumbnail>      
      <dc:creator>Brian Peek, Dan Fernandez</dc:creator>
      <itunes:author>Brian Peek, Dan Fernandez</itunes:author>
      <slash:comments>19</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/Project-Detroit-How-to-Read-Your-Cars-Engine-Data-with-OBD-II/RSS</wfw:commentRss>
      <category>Coding4Fun</category>
      <category>Hardware</category>
      <category>Project Detroit</category>
    </item>
  <item>
      <title>Touch hardware and Windows 8</title>
      <description><![CDATA[<p>This video shows some examples of how hardware can affect the Windows 8 touch language. <a href="http://blogs.msdn.com/b/b8/archive/2012/03/28/touch-hardware-and-windows-8.aspx">http://blogs.msdn.com/b/b8/archive/2012/03/28/touch-hardware-and-windows-8.aspx</a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:c135119db70e4f5e8359a00f014b0e87">]]></description>
      <comments>http://channel9.msdn.com/posts/Touch-hardware-and-Windows-8</comments>
      <itunes:summary>This video shows some examples of how hardware can affect the Windows 8 touch language. http://blogs.msdn.com/b/b8/archive/2012/03/28/touch-hardware-and-windows-8.aspx </itunes:summary>
      <itunes:duration>362</itunes:duration>
      <link>http://channel9.msdn.com/posts/Touch-hardware-and-Windows-8</link>
      <pubDate>Wed, 04 Apr 2012 00:02:03 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/posts/Touch-hardware-and-Windows-8</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/e746632a-ee0e-45ea-a55b-4cf308323ca2.jpg" height="270" width="480"></media:thumbnail>
      <media:group>
        <media:content url="http://ak.channel9.msdn.com/ch9/a5d2/3753fdac-b18b-4503-993c-39126fcfa5d2/TouchHardwareAndWindows8.mp4" expression="full" duration="362" fileSize="34621336" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/a5d2/3753fdac-b18b-4503-993c-39126fcfa5d2/TouchHardwareAndWindows8.wmv" expression="full" duration="362" fileSize="77063651" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/a5d2/3753fdac-b18b-4503-993c-39126fcfa5d2/TouchHardwareAndWindows8_high.mp4" expression="full" duration="362" fileSize="76123895" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/a5d2/3753fdac-b18b-4503-993c-39126fcfa5d2/TouchHardwareAndWindows8_mid.mp4" expression="full" duration="362" fileSize="52985385" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/a5d2/3753fdac-b18b-4503-993c-39126fcfa5d2/TouchHardwareAndWindows8_Source.wmv" expression="full" duration="362" fileSize="217911726" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ak.channel9.msdn.com/ch9/a5d2/3753fdac-b18b-4503-993c-39126fcfa5d2/TouchHardwareAndWindows8.wmv" length="77063651" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Roxanne Beaver</dc:creator>
      <itunes:author>Roxanne Beaver</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/posts/Touch-hardware-and-Windows-8/rss</wfw:commentRss>
      <category>Hardware</category>
      <category>Multitouch</category>
      <category>Touch</category>
      <category>Multi Touch</category>
      <category>Windows 8</category>
    </item>
  <item>
      <title>Building Hardware-accelerated Encrypted Storage Devices (eDrives) in Windows 8</title>
      <description><![CDATA[<p>This video presentation discusses how to build hardware-accelerated encrypted storage drives (eDrives) in Windows 8. It also&nbsp;dives into details on&nbsp;the differences between eDrives and self-encrypting drives.</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:a04c8cacd3b344fc80f19fc0018a7c73">]]></description>
      <comments>http://channel9.msdn.com/posts/Building-Hardware-accelerated-Encrypted-Storage-Devices-eDrives-in-Windows-8</comments>
      <itunes:summary>This video presentation discusses how to build hardware-accelerated encrypted storage drives (eDrives) in Windows 8. It also&amp;nbsp;dives into details on&amp;nbsp;the differences between eDrives and self-encrypting drives. </itunes:summary>
      <itunes:duration>596</itunes:duration>
      <link>http://channel9.msdn.com/posts/Building-Hardware-accelerated-Encrypted-Storage-Devices-eDrives-in-Windows-8</link>
      <pubDate>Fri, 23 Dec 2011 06:45:03 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/posts/Building-Hardware-accelerated-Encrypted-Storage-Devices-eDrives-in-Windows-8</guid>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_100_ch9.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_220_ch9.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_512_ch9.jpg" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_custom_ch9.jpg" height="384" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_2MB_ch9.wmv" expression="full" duration="596" fileSize="213385130" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_ch9.mp3" expression="full" duration="596" fileSize="4769198" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_ch9.webm" expression="full" duration="596" fileSize="42923801" type="video/webm" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_ch9.wma" expression="full" duration="596" fileSize="4826399" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_ch9.wmv" expression="full" duration="596" fileSize="56985003" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_high_ch9.mp4" expression="full" duration="596" fileSize="120546683" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_low_ch9.mp4" expression="full" duration="596" fileSize="29175901" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_med_ch9.mp4" expression="full" duration="596" fileSize="88198761" type="video/mp4" medium="video"></media:content>
        <media:content url="http://smooth.ch9.ms/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8.ism/manifest" expression="full" duration="596" fileSize="8638" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ak.channel9.msdn.com/ch9/7c73/a04c8cac-d3b3-44fc-80f1-9fc0018a7c73/BuildingEDrivesInWindows8_ch9.wmv" length="56985003" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Roxanne Beaver</dc:creator>
      <itunes:author>Roxanne Beaver</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/posts/Building-Hardware-accelerated-Encrypted-Storage-Devices-eDrives-in-Windows-8/rss</wfw:commentRss>
      <category>Encryption</category>
      <category>Hardware</category>
      <category>Windows 8</category>
    </item>
  <item>
      <title>Windows 8 Running on ARM </title>
      <description><![CDATA[ <p><span>Roger Gulrajani from the Windows Hardware Ecosystem group shows us a Qualcomm <a href="http://www.qualcomm.com/snapdragon">Snapdragon</a>&nbsp;reference device that uses an ARM processor. This is another example of the types of machines that will be running Windows 8.</span></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:384315ae55154c0789249f5f011867e5">]]></description>
      <comments>http://channel9.msdn.com/posts/Windows-8-Running-on-ARM</comments>
      <itunes:summary> Roger Gulrajani from the Windows Hardware Ecosystem group shows us a Qualcomm Snapdragon&amp;nbsp;reference device that uses an ARM processor. This is another example of the types of machines that will be running Windows 8. </itunes:summary>
      <itunes:duration>215</itunes:duration>
      <link>http://channel9.msdn.com/posts/Windows-8-Running-on-ARM</link>
      <pubDate>Thu, 15 Sep 2011 21:49:23 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/posts/Windows-8-Running-on-ARM</guid>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/67e5/384315ae-5515-4c07-8924-9f5f011867e5/W8SnapDragon_100_ch9.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/67e5/384315ae-5515-4c07-8924-9f5f011867e5/W8SnapDragon_220_ch9.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/67e5/384315ae-5515-4c07-8924-9f5f011867e5/W8SnapDragon_512_ch9.jpg" height="384" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://ak.channel9.msdn.com/ch9/67e5/384315ae-5515-4c07-8924-9f5f011867e5/W8SnapDragon_2MB_ch9.wmv" expression="full" duration="215" fileSize="143096667" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/67e5/384315ae-5515-4c07-8924-9f5f011867e5/W8SnapDragon_ch9.mp3" expression="full" duration="215" fileSize="1727732" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/67e5/384315ae-5515-4c07-8924-9f5f011867e5/W8SnapDragon_ch9.wma" expression="full" duration="215" fileSize="1753307" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/67e5/384315ae-5515-4c07-8924-9f5f011867e5/W8SnapDragon_ch9.wmv" expression="full" duration="215" fileSize="46454724" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/67e5/384315ae-5515-4c07-8924-9f5f011867e5/W8SnapDragon_high_ch9.mp4" expression="full" duration="215" fileSize="89908979" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/67e5/384315ae-5515-4c07-8924-9f5f011867e5/W8SnapDragon_low_ch9.mp4" expression="full" duration="215" fileSize="19533151" type="video/mp4" medium="video"></media:content>
        <media:content url="http://smooth.ch9.ms/ch9/67e5/384315ae-5515-4c07-8924-9f5f011867e5/W8SnapDragon.ism/manifest" expression="full" duration="215" fileSize="8430" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ak.channel9.msdn.com/ch9/67e5/384315ae-5515-4c07-8924-9f5f011867e5/W8SnapDragon_ch9.wmv" length="46454724" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Larry Larsen</dc:creator>
      <itunes:author>Larry Larsen</itunes:author>
      <slash:comments>10</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/posts/Windows-8-Running-on-ARM/rss</wfw:commentRss>
      <category>Hardware</category>
      <category>Windows 8</category>
    </item>
  <item>
      <title>A Tweeting .NET Micro Framework breathalyzer</title>
      <description><![CDATA[ <p>This project shows how you can use the Netduino Plus to make a tweeting breathalyzer—a standalone breathalyzer that can post messages about the detected alcohol level to Twitter, using an inexpensive alcohol gas sensor.</p><p>The <a href="http://www.netduino.com/">Netduino</a> is an open source electronics platform based on a 32-bit microcontroller running the .NET Micro Framework. The <a href="http://www.netduino.com/netduinoplus/">Netduino Plus</a> is similar to the original Netduino, but adds a built-in Ethernet controller and MicroSD slot. Since the Netduino Plus can connect directly to a network, it can independently communicate with Twitter’s API without being connected to a computer.</p><h3>Hardware Overview</h3><p>&nbsp;</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/Img0058%5B4%5D.jpg"><img title="Img0058" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/Img0058_thumb%5B1%5D.jpg" alt="Img0058" width="640" height="438" border="0"></a></p><p>The <a href="http://www.makershed.com/ProductDetails.asp?ProductCode=MSMS01&amp;Click=37845">MakerShield</a> is a simple prototyping shield that is compatible with the standard Arduino and Netduino boards.</p><p>In this configuration, the MQ-3 alcohol gas sensor will output an analog voltage between 0 and 3.3V to indicate the amount of alcohol detected. This output will be connected to one of the Netduino’s analog input pins and read by its ADC.</p><p>While it would possible to convert the sensor’s output to a numeric BAC level, this would require careful calibration and would be prone to error. For this project, I will use approximate value ranges to determine which of several messages should be posted to Twitter. An approximate reading will be displayed on an RGB LED.</p><h4>RGB LED</h4><p>The RGB LED is the primary status indicator. During normal operation, it shows the level of alcohol, represented by colors ranging from green to red.</p><p>Three transistors are used to provide power to the RGB LED. The microcontroller used on the Netduino has a relatively low current limit per IO pin (around 8 mA for most pins) so it is generally not advised to drive LEDs (which can require 20-30 mA) directly from these pins. Using a transistor (or another LED driver) helps ensure that enough power will be made available to each LED without damaging the Netduino.</p><p><a href="http://www.kpsec.freeuk.com/trancirc.htm">This page</a> shows some common transistor circuits, including a few &quot;transistor as a switch&quot; circuits. Since the RGB LED I am using has a common cathode (low side) lead, I am using PNP transistors to switch the anode (high side) of each color.</p><h4>Alcohol Gas Sensor</h4><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/sensorschematic%5B2%5D.png"><img title="sensorschematic" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/sensorschematic_thumb.png" alt="sensorschematic" width="385" height="278" border="0"></a></p><p>The MQ-3 essentially has two components: a heater and an alcohol gas sensor. The heater literally applies heat to the sensor in order to provide more accurate measurements and requires a constant 5V power source. The alcohol sensor acts as a variable resistor, where the resistance decreases as the level of alcohol increases.</p><p>While the heating element requires 5V, the alcohol sensor can actually operate at a different voltage. Applying 3.3V to the sensor (V<sub>C</sub> in the above diagram) will ensure that the output voltage (V<sub>RL</sub>) doesn’t exceed the Netduino’s input limits.</p><p>The sensor and R<sub>L</sub> act as a voltage divider. The <a href="http://www.pololu.com/file/0J310/MQ3.pdf">datasheet</a> for this sensor shows that the resistance across the sensor is between 2K-20K ohms, so an R<sub>L</sub> value of 10K ohms will provide a wide voltage output range.</p><h4>Other Components</h4><p>The MakerShield has two LEDs that I am using to display some additional status information. The red LED indicates whether the device is ready to post to Twitter, and the Green LED indicates that a post is in progress.</p><p>I am also using the button on the MakerShield to trigger the Netduino to post a message on Twitter. You could also write code to automatically post based on level peak detection, but for simplicity I decided to just use the button as a trigger.</p><h3>Code</h3><p>Pin configuration, Twitter API keys, the NTP server address, and other settings are stored in a Config class (Config.cs in the project root). If you download the source code for this project from CodePlex, make sure you copy the Config.sample.cs to Config.cs and take a look through the file to confirm all the settings:</p><p><pre class="brush: csharp">public static class Config
{
    // NTP Server
    public const string NTPServer = &quot;time-a.nist.gov&quot;;
    public const int TimeOffset = -7;    // MakerShield LEDs
    public const Cpu.Pin RedLEDPin = Pins.GPIO_PIN_A5;
    public const Cpu.Pin GreenLEDPin = Pins.GPIO_PIN_A4;    // RGB LED
    public const Cpu.Pin RGBRedPin = Pins.GPIO_PIN_D10;
    public const Cpu.Pin RGBGreenPin = Pins.GPIO_PIN_D6;
    public const Cpu.Pin RGBBluePin = Pins.GPIO_PIN_D9;
    public const bool RGBInverted = true;    // Button
    public const Cpu.Pin ButtonPin = Pins.GPIO_PIN_A3;    // Alcohol Gas Sensor
    public const Cpu.Pin SensorPin = Pins.GPIO_PIN_A0;
    // The Netduino's 10-bit ADC has a maximum value of 1023, but the sensor may not reach the highest possible voltage.
    // Input values &gt;= the SensorMaxValue will be treated as 100%.
    public const int SensorMaxValue = 900;    // Twitter
    public const string ConsumerKey = &quot;YourConsumerKey&quot;;
    public const string ConsumerSecret = &quot;YourConsumerSecret&quot;;
    public const string UserToken = &quot;YourUserToken&quot;;
    public const string UserTokenSecret = &quot;YourUserTokenSecret&quot;;
}</pre></p><p>In order to post messages on Twitter, it is necessary to register an application through Twitter’s developer portal. Instructions for this can be found on the <a href="http://microtweet.codeplex.com">MicroTweet CodePlex Page</a>.</p><h4>Startup</h4><p>When the Netduino first powers on it will wait for a few moments to let the alcohol gas sensor heat up and establish a baseline reading. The sensor’s datasheet recommends a preheat time of 24-48 hours, but the readings typically stabilize after a few minutes. During this time the RGB LED will slowly fade from blue to red to indicate that the sensor is heating up.</p><h4>RGB LED</h4><p>A simple RGB LED helper class is included to help make controlling the color and output of the LED easier. The class must be instantiated with three Cpu.Pin addresses, one for each color:</p><p><pre class="brush: csharp">protected static RGBLED rgbLed = new RGBLED(Config.RGBRedPin, Config.RGBGreenPin, Config.RGBBluePin, Config.RGBInverted);</pre></p><p>In the sample code, these pins are pulled from the Config class. The last parameter for the RGBLED constructor, invertOutput, is used to determine whether a logical high output value turns the LED on or off.</p><h4>NTP</h4><p>Next, the Netduino will attempt to update the system time from an NTP server. This is necessary for communication with Twitter’s OAuth API because all requests must contain an accurate timestamp. If the NTP server is unreachable, the Twitter functionality will be disabled, but it will still be possible to see the alcohol level on the RGB LED.</p><p>The code to communicate with an NTP server is included with the MicroTweet library. The UpdateTimeFromNTPServer method will contact the specified NTP server and update the Netduino’s time:</p><p><pre class="brush: csharp">NTP.UpdateTimeFromNTPServer(Config.NTPServer);</pre></p><p>If the time is updated successfully, a new instance of the TwitterClient class is created:</p><p><pre class="brush: csharp">twitterClient = new TwitterClient(Config.ConsumerKey, Config.ConsumerSecret, Config.UserToken, Config.UserTokenSecret);</pre></p><h4>Measurements</h4><p>Measurements from the alcohol sensor are repeatedly taken within the main program loop. The 10-bit ADC will return a value between 0 and 1023, but these values don’t necessarily correspond to the minimum/maximum readings from the alcohol sensor so some calculations are performed to convert the ADC value to a number between 0 and 100:</p><p><pre class="brush: csharp">protected static AnalogInput SensorInput = new AnalogInput(Config.SensorPin);// ...public static int GetSensorValue()
{
    int rawValue;
    lock (SensorInput)
    {
        rawValue = SensorInput.Read();
    }
    int adjustedValue = (rawValue - SensorMinValue) * 100;
    int result = adjustedValue / (Config.SensorMaxValue - SensorMinValue);
    return result;
}</pre></p><p>SensorMinValue is the baseline measurement established when the program was starting up. Config.SensorMaxValue is the configured &quot;maximum&quot; value that indicates the highest detectable alcohol level. Depending on your sensor, this maximum value may need to be adjusted.</p><p>It’s also worth noting that it can take about 30 seconds for the sensor to return to its baseline value after a measurement. This screenshot shows the sensor’s output before and after taking a reading:</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/scope%5B2%5D.png"><img title="scope" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/scope_thumb.png" alt="scope" width="320" height="234" border="0"></a></p><p>In this test, the baseline measurement (with no alcohol applied to the sensor) was about 1V. When alcohol was applied to the sensor the output quickly peaked at just under 3V, and then slowly decreased once the alcohol was removed.</p><h4>Posting to Twitter</h4><p>Sending a tweet from a TwitterClient instance is simple:</p><p><pre class="brush: csharp">twitterClient.SendTweet(&quot;Hello, world!&quot;);</pre></p><p>In this project, the MakerShield’s button is used to trigger the Netduino to post a message on Twitter. This button is monitored by an instance of the InterruptPort class, which fires a C# event when the input changes on the selected pin:</p><p><pre class="brush: csharp">protected static InterruptPort button = new InterruptPort(Config.ButtonPin, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLevelLow);// ...static void button_OnInterrupt(uint data1, uint data2, DateTime time)
{
    if (twitterClient == null)
        return;
    greenLED.Write(true);    int sensorValue = GetSensorValue();    string message;
    if (sensorValue &lt; 20)
        message = &quot;No alcohol detected&quot;;
    else if (sensorValue &lt; 40)
        message = &quot;Tipsy&quot;;
    else if (sensorValue &lt; 60)
        message = &quot;Drunk&quot;;
    else if (sensorValue &lt; 80)
        message = &quot;Whoa! #WINNING&quot;;
    else
        message = &quot;x_x&quot;;    DateTime adjustedTime = DateTime.Now &#43; new TimeSpan(Config.TimeOffset, 0, 0);    message &#43;= &quot; at &quot; &#43; adjustedTime.ToString(&quot;h:mm:ss tt&quot;);    try
    {
        twitterClient.SendTweet(message);
    }
    catch (Exception e)
    {
        Debug.Print(e.ToString());
    }    greenLED.Write(false);
    button.ClearInterrupt();
}</pre></p><p>The button event handler code in this project is relatively simple: the current level from the alcohol sensor is read, a message is generated, and it attempts to post the message to Twitter. The current time is appended to the end of the message to avoid issues with multiple identical tweets.</p><p>&nbsp;</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/twitter%5B2%5D%5B3%5D.png"><img title="twitter[2]" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/twitter%5B2%5D_thumb%5B4%5D.png" alt="twitter[2]" width="318" height="357" border="0"></a></p><h3>Conclusion</h3><p>The code for this project is included in the Samples folder of the MicroTweet library. Be sure to check out the <a href="http://microtweet.codeplex.com">MicroTweet project page</a> on CodePlex for the source code and more information.</p><p>MicroTweet is released under the Apache 2.0 license, so it can be freely used in your own projects with attribution.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/Img0044%5B4%5D.jpg"><img title="Img0044" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/Img0044_thumb%5B1%5D.jpg" alt="Img0044" width="640" height="445" border="0"></a></p><h3>About the Author</h3><p>Matt Isenhower is a desktop and mobile application developer who primarily works with the .NET Framework. His company, <a href="http://komodex.com">Komodex Systems</a>, is currently focused on building new and exciting apps for Windows Phone 7 and other platforms. He also has a <a href="http://blog.ike.to">blog</a> and can be followed on Twitter at <a href="http://twitter.com/mattisenhower">@mattisenhower</a>.</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:aa3691d065274ffe84a59ee7012ffc85">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/A-Tweeting-NET-Micro-Framework-breathalyzer</comments>
      <itunes:summary> This project shows how you can use the Netduino Plus to make a tweeting breathalyzer—a standalone breathalyzer that can post messages about the detected alcohol level to Twitter, using an inexpensive alcohol gas sensor. The Netduino is an open source electronics platform based on a 32-bit microcontroller running the .NET Micro Framework. The Netduino Plus is similar to the original Netduino, but adds a built-in Ethernet controller and MicroSD slot. Since the Netduino Plus can connect directly to a network, it can independently communicate with Twitter’s API without being connected to a computer. Hardware Overview&amp;nbsp;  The MakerShield is a simple prototyping shield that is compatible with the standard Arduino and Netduino boards. In this configuration, the MQ-3 alcohol gas sensor will output an analog voltage between 0 and 3.3V to indicate the amount of alcohol detected. This output will be connected to one of the Netduino’s analog input pins and read by its ADC. While it would possible to convert the sensor’s output to a numeric BAC level, this would require careful calibration and would be prone to error. For this project, I will use approximate value ranges to determine which of several messages should be posted to Twitter. An approximate reading will be displayed on an RGB LED. RGB LEDThe RGB LED is the primary status indicator. During normal operation, it shows the level of alcohol, represented by colors ranging from green to red. Three transistors are used to provide power to the RGB LED. The microcontroller used on the Netduino has a relatively low current limit per IO pin (around 8 mA for most pins) so it is generally not advised to drive LEDs (which can require 20-30 mA) directly from these pins. Using a transistor (or another LED driver) helps ensure that enough power will be made available to each LED without damaging the Netduino. This page shows some common transistor circuits, including a few &amp;quot;transistor as a switch&amp;quot; circuits. Since the RGB</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/A-Tweeting-NET-Micro-Framework-breathalyzer</link>
      <pubDate>Wed, 18 May 2011 20:17:55 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/A-Tweeting-NET-Micro-Framework-breathalyzer</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/5a0fa24f-c2b7-4983-8cfc-f7a83e82ac44.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/87d49a7c-d4b9-4789-93c5-e19821d1aba1.jpg" height="165" width="220"></media:thumbnail>      
      <dc:creator>Matt Isenhower</dc:creator>
      <itunes:author>Matt Isenhower</itunes:author>
      <slash:comments>12</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/A-Tweeting-NET-Micro-Framework-breathalyzer/RSS</wfw:commentRss>
      <category>.NET Micro Framework</category>
      <category>Hardware</category>
      <category>Electronics</category>
    </item>
  <item>
      <title>New Book Explores How to Determine Your Hardware Requirements for SQL Server</title>
      <description><![CDATA[ <p>A new book, <strong><a href="http://www.amazon.com/SQL-Server-Hardware-Glenn-Berry/dp/1906434638/">SQL Server Hardware</a></strong>,&nbsp;tells you what you need to know about your hardware before you create your database.&nbsp;The book&nbsp;by <a href="http://mvp.support.microsoft.com/">Most Valued Professional </a>Glenn Berry of Newsgator describes how you can determine your hardware requirements for SQL Server.</p><p>Glenn shares his expertise gained at <a href="http://www.newsgator.com/">Newsgator </a>with ISV Architect Evangelist Bruce Kyle. Glenn's book, <a href="http://www.simple-talk.com/content/article.aspx?article=1199">SQL Server Hardware </a>from <a href="http://simple-talk.com/">Simple Talk Press</a>&nbsp;provides the fundamental knowledge and resources you need to make intelligent decisions about choice, and optimal installation and configuration, of SQL Server hardware, operating system and SQL Server.</p><p>Glenn provides a few tips from his book in this video.</p><p>You find out more about the book on Amazon. See <a href="http://www.amazon.com/SQL-Server-Hardware-Glenn-Berry/dp/1906434638/">SQL Server Hardware</a>.</p><h3>Chapter Outline</h3><ol><li>Processors and Associated Hardware </li><li>The Storage Subsystem </li><li>Benchmarking Tools </li><li>Hardware Discovery </li><li>Operating System Selection and Configuration </li><li>SQL Server Version and Edition Selection </li><li>SQL Server Installation and Configuration </li></ol><h3>Glenn's Blog</h3><p><a href="http://sqlserverperformance.wordpress.com/">Glenn Berry's SQL Server Performance</a>&nbsp;is one of the best resources for SQL Server tips and tricks. He blogs daily exploring both the hardware and software sides of SQL.</p><p>Follow Glenn on Twitter at <a href="http://twitter.com/GlennAlanBerry">@GlennAlanBerry</a>.</p><p>See his interview with John O'Donnell at <a href="http://channel9.msdn.com/Blogs/jodonnell/Talking-with-NewsGator-at-PDC-2009">Talking with NewsGator at PDC 2009</a>.</p><h3>About Most Valued Professionals (MVP)</h3><p>Microsoft recognizes the best and brightest from technology communities around the world with the <br>Microsoft Most Valuable Professional (MVP) Award. These exceptional community leaders come from a wide range of backgrounds. They are teachers, artists, doctors, engineers, as well as technologists, who actively share their high-quality, real-world technical expertise with the community and with Microsoft.</p><h3>About NewsGator</h3><p>NewsGator was founded in 2004 to realize the potential of RSS (Really Simple Syndication) to transform the way people consume information. Today NewsGator's flagship product - Social Sites – is social computing software that’s built directly into Microsoft SharePoint.</p><h3>Other ISV Videos</h3><p>For other videos about independent software vendors (ISVs):</p><ul><li><a href="http://channel9.msdn.com/Blogs/bruceky/Quark-Extends-SharePoint-for-Dynamic-Publishing">Quark Extends SharePoint for Dynamic Publishing</a></li><li><a href="http://channel9.msdn.com/Blogs/bruceky/ProModel-Adds-Simulation-Visualization-to-Microsoft-Project">ProModel Adds Simulation, Visualization to Microsoft Project</a></li><li><a href="http://channel9.msdn.com/Blogs/bruceky/Thumb-Driven-Workflow-on-Windows-7-Slates-from-Blue-Dot-Solutions">Thumb-Driven Workflow on Windows 7 Slates from Blue Dot Solutions</a></li><li><a href="http://channel9.msdn.com/Blogs/bruceky/Accumulus-Makes-Subscription-Billing-Easy-for-Windows-Azure">Accumulus Makes Subscription Billing Easy for Windows Azure</a></li><li><a href="https://channel9.msdn.com/Blogs/bruceky/Azure-Email-Enables-Lists-Low-Cost-Storage-for-SharePoint">Azure Email-Enables Lists, Low-Cost Storage for SharePoint</a></li><li><a href="http://channel9.msdn.com/Blogs/bruceky/Crowd-Sourcing-Public-Sector-App-for-Windows-Phone-Azure">Crowd-Sourcing Public Sector App for Windows Phone, Azure</a></li><li><a href="http://channel9.msdn.com/Blogs/bruceky/Food-Buster-Game-Achieves-Scalability-with-Windows-Azure">Food Buster Game Achieves Scalability with Windows Azure</a></li></ul><h3>Up to Date News for ISVs and Software Developers</h3><p>See <a href="http://blogs.msdn.com/usivde">US ISV Community blog</a>.</p><p>&nbsp;</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:de365c9f225b438ca2179ecc003adecc">]]></description>
      <comments>http://channel9.msdn.com/Blogs/bruceky/New-Book-Explores-How-to-Determine-Your-Hardware-Requirements-for-SQL-Server</comments>
      <itunes:summary> A new book, SQL Server Hardware,&amp;nbsp;tells you what you need to know about your hardware before you create your database.&amp;nbsp;The book&amp;nbsp;by Most Valued Professional Glenn Berry of Newsgator describes how you can determine your hardware requirements for SQL Server. Glenn shares his expertise gained at Newsgator with ISV Architect Evangelist Bruce Kyle. Glenn&#39;s book, SQL Server Hardware from Simple Talk Press&amp;nbsp;provides the fundamental knowledge and resources you need to make intelligent decisions about choice, and optimal installation and configuration, of SQL Server hardware, operating system and SQL Server. Glenn provides a few tips from his book in this video. You find out more about the book on Amazon. See SQL Server Hardware. Chapter OutlineProcessors and Associated Hardware The Storage Subsystem Benchmarking Tools Hardware Discovery Operating System Selection and Configuration SQL Server Version and Edition Selection SQL Server Installation and Configuration Glenn&#39;s BlogGlenn Berry&#39;s SQL Server Performance&amp;nbsp;is one of the best resources for SQL Server tips and tricks. He blogs daily exploring both the hardware and software sides of SQL. Follow Glenn on Twitter at @GlennAlanBerry. See his interview with John O&#39;Donnell at Talking with NewsGator at PDC 2009. About Most Valued Professionals (MVP)Microsoft recognizes the best and brightest from technology communities around the world with the Microsoft Most Valuable Professional (MVP) Award. These exceptional community leaders come from a wide range of backgrounds. They are teachers, artists, doctors, engineers, as well as technologists, who actively share their high-quality, real-world technical expertise with the community and with Microsoft. About NewsGatorNewsGator was founded in 2004 to realize the potential of RSS (Really Simple Syndication) to transform the way people consume information. Today NewsGator&#39;s flagship product - Social Sites – is social computing software that’s built directly into Mi</itunes:summary>
      <itunes:duration>276</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/bruceky/New-Book-Explores-How-to-Determine-Your-Hardware-Requirements-for-SQL-Server</link>
      <pubDate>Mon, 16 May 2011 20:07:36 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/bruceky/New-Book-Explores-How-to-Determine-Your-Hardware-Requirements-for-SQL-Server</guid>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/decc/de365c9f-225b-438c-a217-9ecc003adecc/sqlserverperformance_100_ch9.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/decc/de365c9f-225b-438c-a217-9ecc003adecc/sqlserverperformance_220_ch9.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/decc/de365c9f-225b-438c-a217-9ecc003adecc/sqlserverperformance_512_ch9.jpg" height="384" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://ak.channel9.msdn.com/ch9/decc/de365c9f-225b-438c-a217-9ecc003adecc/sqlserverperformance_2MB_ch9.wmv" expression="full" duration="276" fileSize="572731925" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/decc/de365c9f-225b-438c-a217-9ecc003adecc/sqlserverperformance_ch9.mp3" expression="full" duration="276" fileSize="2217264" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/decc/de365c9f-225b-438c-a217-9ecc003adecc/sqlserverperformance_ch9.wma" expression="full" duration="276" fileSize="2245963" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/decc/de365c9f-225b-438c-a217-9ecc003adecc/sqlserverperformance_ch9.wmv" expression="full" duration="276" fileSize="59431089" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/decc/de365c9f-225b-438c-a217-9ecc003adecc/sqlserverperformance_high_ch9.mp4" expression="full" duration="276" fileSize="116793553" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/decc/de365c9f-225b-438c-a217-9ecc003adecc/sqlserverperformance_low_ch9.mp4" expression="full" duration="276" fileSize="25427038" type="video/mp4" medium="video"></media:content>
        <media:content url="http://smooth.ch9.ms/ch9/decc/de365c9f-225b-438c-a217-9ecc003adecc/sqlserverperformance.ism/manifest" expression="full" duration="276" fileSize="10174" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ak.channel9.msdn.com/ch9/decc/de365c9f-225b-438c-a217-9ecc003adecc/sqlserverperformance_ch9.wmv" length="59431089" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Bruce D Kyle</dc:creator>
      <itunes:author>Bruce D Kyle</itunes:author>
      <slash:comments>1</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/bruceky/New-Book-Explores-How-to-Determine-Your-Hardware-Requirements-for-SQL-Server/RSS</wfw:commentRss>
      <category>Computer Hardware</category>
      <category>Data</category>
      <category>Data Services</category>
      <category>Hardware</category>
      <category>ISV</category>
      <category>SQL</category>
      <category>SQL Server</category>
      <category>Storage</category>
      <category>USISV</category>
    </item>
  <item>
      <title>MJPEG Decoder</title>
      <description><![CDATA[ <p>Last year the Coding4Fun/Channel 9 guys asked me to work on a few things for <a href="http://live.visitmix.com/" target="_blank">MIX10</a>.&nbsp; One of these items was a way to output a webcam stream to Windows Phone 7 for use with Clint's <a href="http://blogs.msdn.com/b/coding4fun/archive/2010/03/16/9979874.aspx" target="_blank">t-shirt cannon project</a> you may have read about.&nbsp; I figured the easiest way to accomplish this was by using a network/IP camera capable of sending a Motion-JPEG stream, which can be easily decoded and displayed that can display a JPEG image.&nbsp; Thus, this library was born.</p><p>It has gone through quite a few changes and I have expanded it to easily display MJPEG streams on a variety of platforms.&nbsp; The developer just references the assembly appropriate to their platform, adds a few lines of code, and away it goes.</p><h2>Usage</h2><p>For those that are just interested in the usage, it's as simple as this:</p><ol><li>Reference one of the following assemblies appropriate for your project: <ul><li><strong>MjpegProcessorSL.dll</strong> - Silverlight (<strong>Out of Browser Only!</strong>) </li><li><strong>MjpegProcessorWP7.dll</strong> - Windows Phone 7 (XNA or Silverlight, performance maxes out around 320x240 @ 15fps, so set your camera settings accordingly) </li><li><strong>MjpegProcessorXna4.dll</strong> - XNA 4.0 (Windows) </li><li><strong>MjpegProcessor.dll</strong> - WinForms and WPF </li></ul></li><li>Create a new <strong>MjpegDecoder</strong> object. </li><li>Hook up the <strong>FrameReady</strong> event. </li><li>In the event handler, take the <strong>Bitmap</strong>/<strong>BitmapImage</strong> and assign it to your image display control: </li><li>In the case of XNA, use the <strong>GetMjpegFrame</strong> method in the Update method, which will return a Texture2D you can use in your Draw method. </li><li>Call the <strong>ParseStream</strong> method with the Uri of the MJPEG &quot;endpoint&quot;. </li></ol><p>That's it!&nbsp; The source code and binaries above both include projects demonstrating how to use the library on each of these platforms.&nbsp; As long as you set the appropriate reference, you can just copy and paste the code in the sample to get your project running (changing the Uri, of course).</p><pre class="brush: csharp;">public partial class MainWindow : Window
{
    MjpegDecoder _mjpeg;

    public MainWindow()
    {
        InitializeComponent();
        _mjpeg = new MjpegDecoder();
        _mjpeg.FrameReady &#43;= mjpeg_FrameReady;
    }

    private void Start_Click(object sender, RoutedEventArgs e)
    {
        _mjpeg.ParseStream(new Uri(&quot;http://192.168.2.200/img/video.mjpeg&quot;));
    }

    private void mjpeg_FrameReady(object sender, FrameReadyEventArgs e)
    {
        image.Source = e.BitmapImage;
    }
}</pre><p>If that doesn't fit your needs, you can also access the <strong>Bitmap/BitmapImage</strong> properties directly from the <strong>MjpegDecoder</strong> object, or the <strong>CurrentFrame</strong> property, which will contain the raw JPEG data prior to being decoded.</p><h2>A Word About Network/IP Cameras</h2><p>I have tested this against several different cameras.&nbsp; Each device has its own quirks, but all of them seem to work with this library with one exception:&nbsp; several cameras will respond differently when an Internet Explorer user agent header is sent with the HTTP request.&nbsp; Instead of sending down an MJPEG stream, it will send a single JPEG image as Internet Explorer does not properly support MJPEG streams.&nbsp; Unfortunately, this causes the Silverlight processor to not work properly as the header cannot be changed from the Internet Explorer default.&nbsp; When this happens, only a single frame will be sent, and the decoding will fail.&nbsp; The only fix I have found is to use a different camera that doesn't work in this way.</p><h2>What is MJPEG?</h2><p>Pretty simply, it's a video format where each frame of video is sent as a separate, compressed JPEG image.&nbsp; A standard HTTP request is made to a specific URL, and a multipart response is sent.&nbsp; Parsing this multipart stream into separate images as they are sent results in a series of JPEG images.&nbsp; The viewer displays those JPEG images as quickly as they are sent and that creates the video.&nbsp; It's not a well documented format, nor is it perfectly standardized, but it does work.&nbsp; For more information, see the <a href="http://en.wikipedia.org/wiki/Motion_JPEG" target="_blank">MJPEG article on Wikipedia</a>.</p><h2>How Do I Find the MJPEG URL of My Camera?</h2><p>Excellent question.&nbsp; Not an excellent answer.&nbsp; The user manual may mention the URL.&nbsp; A quick internet search with the model number should get you a result.&nbsp; Or, you can also try this company's <a href="http://skjm.com/icam/mjpeg.php" target="_blank">lookup tool</a>.</p><h2>How Does It Work?</h2><p>Glad you asked.&nbsp; If you take a look at the project, you'll notice there isn't much code.&nbsp; One single file is used with a variety of compiler directives to compile certain portions based on the platform assembly being generated.&nbsp; The <strong>MjpegDecoder.cs/.vb </strong>contains the entire implementation.</p><p>First, an asynchronous request is made to the provided MJPEG URL inside the <strong>ParseStream</strong> method.&nbsp; If we are in a Silverlight environment, the <strong>AllowReadStreamBuffering</strong> property must be set to <strong>false</strong> so the response returns immediately instead of being buffered.&nbsp; Additionally, we need to register the <strong>http://</strong> prefix to use the client http stack vs. the browser stack.&nbsp; Finally, the request is made using the <strong>BeginGetResponse</strong> method, specifying the <strong>OnGetResponse</strong> method as the callback.&nbsp; This will be called as soon as data is sent from the camera in response to our request.</p><pre class="brush: csharp;">public void ParseStream(Uri uri)
{
#if SILVERLIGHT
    HttpWebRequest.RegisterPrefix(&quot;http://&quot;, WebRequestCreator.ClientHttp);
#endif
    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);

#if SILVERLIGHT
    // start the stream immediately
    request.AllowReadStreamBuffering = false;
#endif
    // asynchronously get a response
    request.BeginGetResponse(OnGetResponse, request);
}</pre><p><strong>OnGetResponse</strong> grabs the response headers and uses the Content-Type header to determine the boundary marker that will be sent between JPEG frames.</p><pre class="brush: csharp;">private void OnGetResponse(IAsyncResult asyncResult)
{
    HttpWebResponse resp;
    byte[] buff;
    byte[] imageBuffer = new byte[1024 * 1024];
    Stream s;

    // get the response
    HttpWebRequest req = (HttpWebRequest)asyncResult.AsyncState;
    resp = (HttpWebResponse)req.EndGetResponse(asyncResult);

    // find our magic boundary value
    string contentType = resp.Headers[&quot;Content-Type&quot;];
    if(!string.IsNullOrEmpty(contentType) &amp;&amp; !contentType.Contains(&quot;=&quot;))
        throw new Exception(&quot;Invalid content-type header.  The camera is likely not returning a proper MJPEG stream.&quot;);
    string boundary = resp.Headers[&quot;Content-Type&quot;].Split('=')[1];
    byte[] boundaryBytes = Encoding.UTF8.GetBytes(boundary.StartsWith(&quot;--&quot;) ? boundary : &quot;--&quot; &#43; boundary);
...</pre><p>&nbsp;</p><p>It then streams the response data, looks for a JPEG header marker, then reads until it finds the boundary marker, copies the data into a buffer, decodes it, passes it on to whoever wants it via an event, and then starts over.</p><pre class="brush: csharp;">...
    s = resp.GetResponseStream();
    BinaryReader br = new BinaryReader(s);

    _streamActive = true;

    buff = br.ReadBytes(ChunkSize);

    while (_streamActive)
    {
        int size;

        // find the JPEG header
        int imageStart = buff.Find(JpegHeader);

        if(imageStart != -1)
        {
            // copy the start of the JPEG image to the imageBuffer
            size = buff.Length - imageStart;
            Array.Copy(buff, imageStart, imageBuffer, 0, size);

            while(true)
            {
                buff = br.ReadBytes(ChunkSize);

                // find the boundary text
                int imageEnd = buff.Find(boundaryBytes);
                if(imageEnd != -1)
                {
                    // copy the remainder of the JPEG to the imageBuffer
                    Array.Copy(buff, 0, imageBuffer, size, imageEnd);
                    size &#43;= imageEnd;

                    // create a single JPEG frame
                    CurrentFrame = new byte[size];
                    Array.Copy(imageBuffer, 0, CurrentFrame, 0, size);
#if !XNA
                    ProcessFrame(CurrentFrame);
#endif
                    // copy the leftover data to the start
                    Array.Copy(buff, imageEnd, buff, 0, buff.Length - imageEnd);

                    // fill the remainder of the buffer with new data and start over
                    byte[] temp = br.ReadBytes(imageEnd);

                    Array.Copy(temp, 0, buff, buff.Length - imageEnd, temp.Length);
                    break;
                }

                // copy all of the data to the imageBuffer
                Array.Copy(buff, 0, imageBuffer, size, buff.Length);
                size &#43;= buff.Length;
            }
        }
    }
    resp.Close();
}</pre><p>The <strong>ProcessFrame </strong>method seen above takes the raw byte buffer, which contains an undecoded JPEG image, and decodes it based on the environment.&nbsp; However this isn't called in the case of XNA which we'll see in a moment:</p><pre class="brush: csharp;">private void ProcessFrame(byte[] frameBuffer)
{
#if SILVERLIGHT
    // need to get this back on the UI thread
    Deployment.Current.Dispatcher.BeginInvoke((Action)(() =&gt;
    {
        // resets the BitmapImage to the new frame
        BitmapImage.SetSource(new MemoryStream(frameBuffer, 0, frameBuffer.Length));

        // tell whoever's listening that we have a frame to draw
        if(FrameReady != null)
            FrameReady(this, new FrameReadyEventArgs { FrameBuffer = CurrentFrame, BitmapImage = BitmapImage });
    }));
#endif

#if !SILVERLIGHT &amp;&amp; !XNA
    // I assume if there's an Application.Current then we're in WPF, not WinForms
    if(Application.Current != null)
    {
        // get it on the UI thread
        Application.Current.Dispatcher.BeginInvoke((Action)(() =&gt;
        {
            // create a new BitmapImage from the JPEG bytes
            BitmapImage = new BitmapImage();
            BitmapImage.BeginInit();
            BitmapImage.StreamSource = new MemoryStream(frameBuffer);
            BitmapImage.EndInit();

            // tell whoever's listening that we have a frame to draw
            if(FrameReady != null)
                FrameReady(this, new FrameReadyEventArgs { FrameBuffer = CurrentFrame, Bitmap = Bitmap, BitmapImage = BitmapImage });
        }));
    }
    else
    {
        // create a simple GDI&#43; happy Bitmap
        Bitmap = new Bitmap(new MemoryStream(frameBuffer));

        // tell whoever's listening that we have a frame to draw
        if(FrameReady != null)
            FrameReady(this, new FrameReadyEventArgs { FrameBuffer = CurrentFrame, Bitmap = Bitmap, BitmapImage = BitmapImage });
    }
#endif
}</pre><div>&nbsp;</div><p>In the case of Silverlight, the <strong>BitmapImage</strong> object has a <strong>SetSource</strong> method which takes a stream to be decoded and turned into the image.&nbsp; In WPF, <strong>BitmapImage</strong> works differently.&nbsp; In this case, <strong>BeginInit</strong> is called, then the <strong>StreamSource</strong> property is set to the stream of bytes, and finally <strong>EndInit</strong> is called.&nbsp; In WinForms, the library will return a <strong>Bitmap</strong> object which can be initialized with the stream right in the constructor.</p><p>In the code above, I look at the <strong>Application.Current</strong> property to determine if the library is being used by a WPF project.&nbsp; If that property is not null, it is assumed the library is being called from a WPF project.</p><p>When compiled as an XNA library, we have no use for a <strong>BitmapImage</strong> or a <strong>Bitmap</strong>â€¦we need a <strong>Texture2D</strong> object.&nbsp; The <strong>GetMjpegFrame</strong> method seen below is what is called by an XNA application during the Update method to pull the current frame:</p><pre class="brush: csharp;">public Texture2D GetMjpegFrame(GraphicsDevice graphicsDevice)
{
    // create a Texture2D from the current byte buffer
    if(CurrentFrame != null)
        return Texture2D.FromStream(graphicsDevice, new MemoryStream(CurrentFrame, 0, CurrentFrame.Length));
    return null;
}</pre><h2>Conclusion</h2><p>And that's about it for the library.&nbsp; Give it a try and please contact me with feedback or if you run into any issues.&nbsp; Enjoy!</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:c0c99db087794de090759e86005409c8">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/MJPEG-Decoder</comments>
      <itunes:summary> Last year the Coding4Fun/Channel 9 guys asked me to work on a few things for MIX10.&amp;nbsp; One of these items was a way to output a webcam stream to Windows Phone 7 for use with Clint&#39;s t-shirt cannon project you may have read about.&amp;nbsp; I figured the easiest way to accomplish this was by using a network/IP camera capable of sending a Motion-JPEG stream, which can be easily decoded and displayed that can display a JPEG image.&amp;nbsp; Thus, this library was born. It has gone through quite a few changes and I have expanded it to easily display MJPEG streams on a variety of platforms.&amp;nbsp; The developer just references the assembly appropriate to their platform, adds a few lines of code, and away it goes. UsageFor those that are just interested in the usage, it&#39;s as simple as this: Reference one of the following assemblies appropriate for your project: MjpegProcessorSL.dll - Silverlight (Out of Browser Only!) MjpegProcessorWP7.dll - Windows Phone 7 (XNA or Silverlight, performance maxes out around 320x240 @ 15fps, so set your camera settings accordingly) MjpegProcessorXna4.dll - XNA 4.0 (Windows) MjpegProcessor.dll - WinForms and WPF Create a new MjpegDecoder object. Hook up the FrameReady event. In the event handler, take the Bitmap/BitmapImage and assign it to your image display control: In the case of XNA, use the GetMjpegFrame method in the Update method, which will return a Texture2D you can use in your Draw method. Call the ParseStream method with the Uri of the MJPEG &amp;quot;endpoint&amp;quot;. That&#39;s it!&amp;nbsp; The source code and binaries above both include projects demonstrating how to use the library on each of these platforms.&amp;nbsp; As long as you set the appropriate reference, you can just copy and paste the code in the sample to get your project running (changing the Uri, of course). public partial class MainWindow : Window
{
    MjpegDecoder _mjpeg;

    public MainWindow()
    {
        InitializeComponent();
        _mjpeg = new MjpegDecoder();
        _mjpe</itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/articles/MJPEG-Decoder</link>
      <pubDate>Thu, 10 Feb 2011 05:15:49 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/MJPEG-Decoder</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/2460fbee-0ebb-417a-b39e-bfd61639bde7.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/4dc598a2-fd65-4ce9-ad22-ef149e4ab524.jpg" height="165" width="220"></media:thumbnail>      
      <dc:creator>Brian Peek</dc:creator>
      <itunes:author>Brian Peek</itunes:author>
      <slash:comments>28</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/articles/MJPEG-Decoder/RSS</wfw:commentRss>
      <category>.NET</category>
      <category>.NET Framework</category>
      <category>Hardware</category>
      <category>Silverlight 4</category>
      <category>Windows Forms</category>
      <category>WPF</category>
      <category>XNA</category>
      <category>XNA framework</category>
    </item>
  <item>
      <title>Windows 7 and SSDs</title>
      <description><![CDATA[ <p>Solid State Drives (SSD) are great, but going into that upgrade blind can leave you with less than impressive benchmarks. There are a few things you need to know before adding a SSD to your Windows 7 PC. Ed Bott has an article worth reading called <a href="http://www.zdnet.com/blog/bott/windows-7-and-ssds-setup-secrets-and-tune-up-tweaks/2910?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A&#43;zdnet%2FBott&#43;%28ZDNet&#43;Ed&#43;Bott%27s&#43;Microsoft&#43;Report%29&amp;utm_content=Google&#43;Reader">Windows 7 and SSDs: Setup secrets and tune-up tweaks</a>.&nbsp;One of the&nbsp;most important things to know abotu is what TRIM is and how to make sure you're using it. As Ed shows you, it can mean the difference between 10.77 MB/s random reads and 130.25 MB/s, a difference worth knowing about. </p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:ca2ab600cb2348a493ab9e790120271d">]]></description>
      <comments>http://channel9.msdn.com/Blogs/coolstuff/Windows-7-and-SSDs</comments>
      <itunes:summary> Solid State Drives (SSD) are great, but going into that upgrade blind can leave you with less than impressive benchmarks. There are a few things you need to know before adding a SSD to your Windows 7 PC. Ed Bott has an article worth reading called Windows 7 and SSDs: Setup secrets and tune-up tweaks.&amp;nbsp;One of the&amp;nbsp;most important things to know abotu is what TRIM is and how to make sure you&#39;re using it. As Ed shows you, it can mean the difference between 10.77 MB/s random reads and 130.25 MB/s, a difference worth knowing about.  </itunes:summary>
      <link>http://channel9.msdn.com/Blogs/coolstuff/Windows-7-and-SSDs</link>
      <pubDate>Fri, 28 Jan 2011 17:35:21 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/coolstuff/Windows-7-and-SSDs</guid>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/0139b6d9-693c-4676-8688-8f2ec5e7e362.png" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://files.channel9.msdn.com/thumbnail/e24aad43-c820-4bf3-8a98-b35ba6475a0b.png" height="165" width="220"></media:thumbnail>      
      <dc:creator>Larry Larsen</dc:creator>
      <itunes:author>Larry Larsen</itunes:author>
      <slash:comments>8</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/coolstuff/Windows-7-and-SSDs/RSS</wfw:commentRss>
      <category>Hardware</category>
      <category>Windows 7</category>
      <category>SSD</category>
    </item>
  <item>
      <title>PC Showcase with Ben the PC Guy </title>
      <description><![CDATA[ <p>Ben the PC Guy walked us through some of the coolest PC's in the Microsoft booth. There are so many to choose from with such different features, from high end laptops built for gaming or video editing to the incredible cut lines&nbsp;of the Samsung 9 Series to the futuristic dual-screened Acer ICONIA.&nbsp;There is something for everyone. </p><p>Follow Ben <a href="http://twitter.com/benthepcguy">on Twitter</a> or see more on the <a href="http://windowsteamblog.com/">Windows Team Blog</a>. </p><p><strong>00:25 - <a href="http://www.acer.com/iconia/">Acer ICONIA</a></strong> - Dual screen multitouch laptop. We looked at one in the back of the booth because there was a constant crowd around the one out front. Place 5 fingers on the bottom screen to bring up a wheel launcer or 10 fingers to bring up the keyboard. <br><strong>02:00 - <a href="http://www.bing.com/shopping/toshiba-satellite-a665-3dv-core-i7-740qm-1-73-ghz-15-6-tft/reviews/21601FBD1FD34E150001?q=Toshiba&#43;satillite&#43;A665-3Dv&amp;FORM=GR">Toshiba Satellite A665-3D</a></strong> - A fast i7-based gaming laptop with 3D glasses with a retail price of around $1300. <br><strong>02:33 - <a href="http://www.sonystyle.com/webapp/wcs/stores/servlet/CategoryDisplay?storeId=10151&amp;catalogId=10551&amp;langId=-1&amp;categoryId=8198552921644608896">Sony Vaio P</a></strong> - 8&quot; screen that fits in a back pocket. It has available turn-by-turn GPS navigation and Verizon Broadband built in. <br><strong>03:18 - <a href="http://www.hp.com/united-states/campaigns/holiday-beats/envy17.html">HP Envy 14</a></strong><a href="http://www.hp.com/united-states/campaigns/holiday-beats/envy17.html">&nbsp;</a>- The brains inside the much-feared and&nbsp;arguably dangerous <a href="http://blog.makezine.com/archive/2010/03/windows_phone-powered_t-shirt_canno.html">Coding4Fun T-Shirt cannon</a>, the 17&quot; version is my main PC, used to edit many of my Channel 9 videos. Why? Because it's a huge screened beauty with Beats Audio that gets a 7.1 <a href="http://www.weishare.net/">WEI score</a>. <br><strong>04:05 - <a href="http://www.samsung.com/us/news/newsRead.do?news_seq=19774&amp;page=1&amp;gltype=globalnews">Samsung Note PC 9 Series 900X</a></strong> - You've never seen a PC like this before. It's one of the lightest, thinnest 13&quot; laptops in the world. The body is Duralumin aircraft metal which feels both solid as a rock and light as a feather. Backlit keyboard, i5 processor. The screen is twice as bright as what you're probably used to, and for speed - world record holder at 12 seconds boot time.&nbsp;When you retire this machine you could use it to split wood.&nbsp;<br><strong>05:00 - <a href="http://ces2011.asus.com/photos/eee/asus-eee-slate-ep121/">ASUS Eee Slate EP121</a>&nbsp;</strong>- A&nbsp;slate PC that works as a multitouch device, as a&nbsp;Tablet PC, or with a&nbsp;BlueTooth keyboard. Forward facing camera for video chat and a home button that drives <a href="http://windows.microsoft.com/en-US/windows7/Using-Aero-Flip-3D">AeroFlip3d</a>. <br><strong>06:33 - <a href="http://www.dell.com/content/topics/topic.aspx/global/products/landing/en/inspiron?c=us&amp;l=en">Dell Inspiron duo&nbsp;</a></strong>- Very cool little&nbsp;convertible tablet that works as a laptop and&nbsp;with a push the screen flips around and it works as a touch tablet.&nbsp;It has an optional Audio Station, 2GB of RAM and will play HD movies. </p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:0effa94a922f4e7f954b9e650090de97">]]></description>
      <comments>http://channel9.msdn.com/posts/PC-Showcase-with-Ben-the-PC-Guy</comments>
      <itunes:summary> Ben the PC Guy walked us through some of the coolest PC&#39;s in the Microsoft booth. There are so many to choose from with such different features, from high end laptops built for gaming or video editing to the incredible cut lines&amp;nbsp;of the Samsung 9 Series to the futuristic dual-screened Acer ICONIA.&amp;nbsp;There is something for everyone.  Follow Ben on Twitter or see more on the Windows Team Blog.  00:25 - Acer ICONIA - Dual screen multitouch laptop. We looked at one in the back of the booth because there was a constant crowd around the one out front. Place 5 fingers on the bottom screen to bring up a wheel launcer or 10 fingers to bring up the keyboard. 02:00 - Toshiba Satellite A665-3D - A fast i7-based gaming laptop with 3D glasses with a retail price of around $1300. 02:33 - Sony Vaio P - 8&amp;quot; screen that fits in a back pocket. It has available turn-by-turn GPS navigation and Verizon Broadband built in. 03:18 - HP Envy 14&amp;nbsp;- The brains inside the much-feared and&amp;nbsp;arguably dangerous Coding4Fun T-Shirt cannon, the 17&amp;quot; version is my main PC, used to edit many of my Channel 9 videos. Why? Because it&#39;s a huge screened beauty with Beats Audio that gets a 7.1 WEI score. 04:05 - Samsung Note PC 9 Series 900X - You&#39;ve never seen a PC like this before. It&#39;s one of the lightest, thinnest 13&amp;quot; laptops in the world. The body is Duralumin aircraft metal which feels both solid as a rock and light as a feather. Backlit keyboard, i5 processor. The screen is twice as bright as what you&#39;re probably used to, and for speed - world record holder at 12 seconds boot time.&amp;nbsp;When you retire this machine you could use it to split wood.&amp;nbsp;05:00 - ASUS Eee Slate EP121&amp;nbsp;- A&amp;nbsp;slate PC that works as a multitouch device, as a&amp;nbsp;Tablet PC, or with a&amp;nbsp;BlueTooth keyboard. Forward facing camera for video chat and a home button that drives AeroFlip3d. 06:33 - Dell Inspiron duo&amp;nbsp;- Very cool little&amp;nbsp;convertible tablet that works as a laptop and&amp;nbsp;</itunes:summary>
      <itunes:duration>480</itunes:duration>
      <link>http://channel9.msdn.com/posts/PC-Showcase-with-Ben-the-PC-Guy</link>
      <pubDate>Sat, 08 Jan 2011 10:35:23 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/posts/PC-Showcase-with-Ben-the-PC-Guy</guid>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy_100_ch9.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy_220_ch9.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy_512_ch9.jpg" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy_custom_ch9.jpg" height="384" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://ak.channel9.msdn.com/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy_2MB_ch9.wmv" expression="full" duration="480" fileSize="257376519" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy_ch9.mp3" expression="full" duration="480" fileSize="3846590" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy_ch9.wma" expression="full" duration="480" fileSize="3892155" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy_ch9.wmv" expression="full" duration="480" fileSize="104584313" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy_high_ch9.mp4" expression="full" duration="480" fileSize="215087043" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy_low_ch9.mp4" expression="full" duration="480" fileSize="48582098" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy_Zune_ch9.wmv" expression="full" duration="480" fileSize="55544368" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://smooth.ch9.ms/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy.ism/manifest" expression="full" duration="480" fileSize="8410" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ak.channel9.msdn.com/ch9/DE97/0EFFA94A-922F-4E7F-954B-9E650090DE97/BenthePCGuy_ch9.wmv" length="104584313" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Larry Larsen</dc:creator>
      <itunes:author>Larry Larsen</itunes:author>
      <slash:comments>7</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/posts/PC-Showcase-with-Ben-the-PC-Guy/rss</wfw:commentRss>
      <category>Hardware</category>
      <category>Video editing</category>
      <category>Tablet PC</category>
      <category>Gaming hardware</category>
    </item>
  <item>
      <title>Dancing Lights!</title>
      <description><![CDATA[ <p>A few years ago, Brian Peek, created a <a href="http://blogs.msdn.com/b/coding4fun/archive/2007/12/23/1230660.aspx">light sequencing application phidgets to animate your holiday cheer</a> and Don, a coding4fun reader, leveraged it to animate some lights of his own for this year!</p><div id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:0332c214-61c6-4d65-88c8-ef57e864e24e" class="wlWriterEditableSmartContent"><div id="1f8bd787-16c3-46e8-a0be-49adac0e4a87"><div><a href="http://www.youtube.com/watch?v=b3vsHCBDpEM" target="_new"><img src="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10104847/video28d9e9295546.jpg" alt=""></a></div></div></div><p>Awesome job Don and thanks for telling us about it!&nbsp; </p><p>Update:&nbsp; Don has <a href="http://ecn.channel9.msdn.com/o9/c4fcontent/migration/10104847/lightSeq_cBrown.zip">shared his sequence file with us</a>!</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Tags/hardware/RSS&WT.dl=0&WT.entryid=Entry:RSSView:992ca31aafb64656afaa9e7600c6eabc">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/Dancing-Lights</comments>
      <itunes:summary> A few years ago, Brian Peek, created a light sequencing application phidgets to animate your holiday cheer and Don, a coding4fun reader, leveraged it to animate some lights of his own for this year! Awesome job Don and thanks for telling us about it!&amp;nbsp;  Update:&amp;nbsp; Don has shared his sequence file with us! </itunes:summary>
      <link>http://channel9.msdn.com/coding4fun/blog/Dancing-Lights</link>
      <pubDate>Tue, 14 Dec 2010 15:40:12 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/Dancing-Lights</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/10104847_100.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/c4f/images/10104847_220.jpg" height="165" width="220"></media:thumbnail>      
      <dc:creator>Clint Rutkas</dc:creator>
      <itunes:author>Clint Rutkas</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/coding4fun/blog/Dancing-Lights/RSS</wfw:commentRss>
      <category>Hardware</category>
      <category>C4FNews</category>
      <category>Phidgets</category>
      <category>old projects made new</category>
      <category>relays</category>
    </item>    
</channel>
</rss>