<?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>Coding 4 Fun</title>
    <atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/coding4fun/rss"/>
    <generator>Rev9</generator>
    <description></description>
    <link>http://channel9.msdn.com/coding4fun/rss</link>
    <language>en</language>
  <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/coding4fun/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>
      <link>http://channel9.msdn.com/coding4fun/blog/Design-and-simulate-digital-logic-circuits-with-LogicCircuit</link>
      <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 siteThe official web site was created. Please visit it at: http://www.LogicCircuit.orgHow 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 in marked </itunes:summary>
      <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>
      <dc:creator>Greg Duncan</dc:creator>
      <category>csharp</category>
      <category>coding4fun</category>
      <category>hardware</category>
  </item>
  <item>
      <title>Kinect-Controlled Chess Playing Robot</title>
      <description><![CDATA[<p>Today's inspirational video shows how one enterprising student meshed chess, a robotic arm and the Kinect into a very cool project</p><h2>Kinect-Controlled Chess Playing Robot</h2><blockquote><p>As cool as that title was to write, the video is even cooler. This is one of those articles I post simply because of the purely creative and inventive end result of someone's hard work. I doubt the source code will be released any time soon and providing any sort of installation instructions or DIY tutorials is well beyond my skill set.</p><p>With that being said, a game of chess between a computer AI isn't anything new. However, controlling the chess piece using natural gestures while having your opponent (who just happens to be a robotic arm) do all &quot;heavy lifting&quot; certainly is.</p><p>The user is controlling the chess pieces with the Kinect as seen in the screen above. Once a move is completed, the robot will move the piece on the chess board according to your actions and then plays its own move afterwards. I can't help but wonder if the robot is plotting ways to enslave the human race while still thinking at least 3 moves ahead. Love this stuff!</p></blockquote><p><strong>Project Information URL:</strong> <a href="http://developkinect.com/news/robotics/playing-chess-using-kinect-controls-versus-robotic-arm">http://developkinect.com/news/robotics/playing-chess-using-kinect-controls-versus-robotic-arm</a></p><p><a href="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image%5B5%5D-88.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image_thumb%5B1%5D-95.png" alt="image" width="520" height="382" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image%5B2%5D-124.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image_thumb-120.png" alt="image" width="520" height="302" border="0"></a></p><p><object width="400" height="220"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=40676809&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=40676809&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="220"></embed></object><p><a href="http://vimeo.com/40676809">from Vimeo</a>.</p></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/coding4fun/rss&WT.dl=0&WT.entryid=Entry:RSSView:fe475458bebd4f21ae75a05d017374e8">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/kinect/Kinect-Controlled-Chess-Playing-Robot</comments>
      <link>http://channel9.msdn.com/coding4fun/kinect/Kinect-Controlled-Chess-Playing-Robot</link>
      <itunes:summary>Today&#39;s inspirational video shows how one enterprising student meshed chess, a robotic arm and the Kinect into a very cool projectKinect-Controlled Chess Playing RobotAs cool as that title was to write, the video is even cooler. This is one of those articles I post simply because of the purely creative and inventive end result of someone&#39;s hard work. I doubt the source code will be released any time soon and providing any sort of installation instructions or DIY tutorials is well beyond my skill set.With that being said, a game of chess between a computer AI isn&#39;t anything new. However, controlling the chess piece using natural gestures while having your opponent (who just happens to be a robotic arm) do all &amp;quot;heavy lifting&amp;quot; certainly is.The user is controlling the chess pieces with the Kinect as seen in the screen above. Once a move is completed, the robot will move the piece on the chess board according to your actions and then plays its own move afterwards. I can&#39;t help but wonder if the robot is plotting ways to enslave the human race while still thinking at least 3 moves ahead. Love this stuff!Project Information URL: http://developkinect.com/news/robotics/playing-chess-using-kinect-controls-versus-robotic-armfrom Vimeo.</itunes:summary>
      <pubDate>Fri, 01 Jun 2012 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/kinect/Kinect-Controlled-Chess-Playing-Robot</guid>
      <dc:creator>Greg Duncan</dc:creator>
      <category>coding4fun</category>
      <category>kinect</category>
  </item>
  <item>
      <title>Occlusion detection and virtual object manipulation with the Kinect</title>
      <description><![CDATA[<p>Today's inspirational project shows how one team is working with the Kinect and Kinect for Windows SDK to create an augmented reality real...</p><h2>Occlusion detection and virtual object manipulation in augmented reality with the Microsoft Kinect</h2><blockquote><p>Augmented reality (AR) is limited by how you can interact with the virtual object displayed. Currently, the object can only be moved by moving the AR marker. In this project, we used the Microsoft Kinect sensor to allow one to virtually touch and manipulate the object displayed. In order to do this, we use the skeletal tracking of the sensor to allow the user to rotate and resize the object with his hands. While doing so, the user hands will inevitably get between the virtual object and the camera. To prevent the virtual object from being displayed wrongly over the hand, the depth map of the Kinect is used to find any obstruction and block rendering of pixels under occlusion. This is realized at the GPU level, using modified Shaders. The AR system uses the Unity3D game engine to display the 3D models with a custom plugin created at the CIMMI research center to enable the AR. The plugin computes in real time the pose of the Kinect using the color image while the depth map allow occlusion detection and hands tracking. The plugin was developed with the OpenCV library which allows easy analysis of the images. This work was realized at the CIMMI research center (cimmi.qc.ca) by two interns, Alexis Legare-Julien and Renaud Simard, under the supervision of Jean-Nicolas Ouellet, Ph.D.Eng.</p><p>&nbsp;</p><p>Here are some additional details on the project:</p><p>It uses the&nbsp;Kinect color image and depth map to achieve augmented reality with&nbsp;occlusion and object manipulation. Without wasting time, here is the&nbsp;link to the demo (April 2012):&nbsp;<a href="http://www.google.com/url?sa=D&amp;q=http://youtu.be/OTmHtAaQD_c&amp;usg=AFQjCNENrvEtOJKgqrB-52QFcFPDxz_cKg" target="_blank">http://youtu.be/OTmHtAaQD_c</a>&nbsp;</p><p>Now the description:</p><p>We work on augmented reality (AR) where a virtual&nbsp;object is added to a live video stream as if it was really part of the&nbsp;scene. Last year, we developed unity3d plugin that is able to create&nbsp;the AR illusion. Basically it grabs the webcam image and computes the&nbsp;camera position wrt. a marker. Unity then only shows the webcam image&nbsp;superimposed with a render of the virtual object from the correct view&nbsp;point. This video shows what it looks like:&nbsp;<a href="http://www.google.com/url?sa=D&amp;q=http://youtu.be/npuubLGpU1A&amp;usg=AFQjCNHCiKXH0q5G7mr9hREYYVn1LiBRig" target="_blank">http://youtu.be/npuubLGpU1A</a>&nbsp;</p><p>Then we wanted to allow the user to manipulate the state of the&nbsp;object, rotate and resize, with his hands. The Kinect is perfect for&nbsp;that, the skeletal tracking measure where the user is relative to the&nbsp;camera (hand, head, etc). While doing so, we were confronted with the occlusion problem. That is, if the hand is closer to the camera than&nbsp;virtual object, the hand must be seen (we must not render the virtual&nbsp;object over the hand). Again, the Kinect measure the distance of everything it sees, the depth map, the z-distance. Similarly, when a&nbsp;video card renders a virtual scene it computes occlusion from the&nbsp;depth buffer, i.e. the z distance of every object in the virtual&nbsp;scene. The occlusion algorithm is then obvious, on the shader&nbsp;clip( z.real &lt; z.virtual).&nbsp;</p><p>Thus, we used the Kinect (with the Microsoft sdk, but any other sdk&nbsp;with skeletal tracking would do) to manage occlusion and manipulate&nbsp;the virtual objects interactively. Rendering is done in Unity3d free, occlusion is managed in a unity shader (this is very fast since&nbsp;computation is done on the graphic card), manipulation is done in Unity3d from skeletal information from the Kinect.&nbsp;</p><p>The biggest problem we faced was speed, transferring the depth map to&nbsp;the shader was time consuming. We had to resize the depth map to&nbsp;512x512 to allow faster manipulation. While doing so, we were&nbsp;confronted by a new problem; the occlusion clip was highlighting the&nbsp;object contours. So occlusion was correct but when the hand was behind&nbsp;the virtual object we could see through the virtual object at the object boundary. The effect was kind of cool but unwanted.&nbsp;</p><p>After some investigation we found out that opencv was using bilinear&nbsp;interpolation to resize the depth map image. This was creating&nbsp;intermediate values between the background and the object boundaries.&nbsp;Forcing to nearest neighbor interpolation was the solution, but the contours were still there. The shader was interpolating the values&nbsp;when we extracted the depth value from the texture. The coordinates&nbsp;are indexed from 0 to 1 instead of 0 to width (or 0 to height). We had&nbsp;to crop the decimal value of the coordinate to make wure it was falling at the center of the texture pixel to avoid interpolation. While doing so we found out that unity3d is indexing pixels&nbsp;coordinates from the pixel corner, not the center. An offset of 0.5&nbsp;must be added to the coordinate in the native image range.&nbsp;</p></blockquote><p><strong>Project Information URL:</strong> <a href="http://www.youtube.com/watch?v=OTmHtAaQD_c&amp;feature=youtu.be">http://www.youtube.com/watch?v=OTmHtAaQD_c&amp;feature=youtu.be</a></p><p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/OTmHtAaQD_c&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/OTmHtAaQD_c&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/npuubLGpU1A&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/npuubLGpU1A&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p><p><a href="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image%5B11%5D-33.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image_thumb%5B3%5D-36.png" alt="image" width="520" height="360" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image%5B8%5D-50.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image_thumb%5B2%5D-54.png" alt="image" width="520" height="357" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image%5B5%5D-87.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image_thumb%5B1%5D-94.png" alt="image" width="520" height="357" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image%5B2%5D-123.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image_thumb-119.png" alt="image" width="520" height="352" border="0"></a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/coding4fun/rss&WT.dl=0&WT.entryid=Entry:RSSView:f6b63039b7694d419442a05d0168b757">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/kinect/Occlusion-detection-and-virtual-object-manipulation-with-the-Kinect</comments>
      <link>http://channel9.msdn.com/coding4fun/kinect/Occlusion-detection-and-virtual-object-manipulation-with-the-Kinect</link>
      <itunes:summary>Today&#39;s inspirational project shows how one team is working with the Kinect and Kinect for Windows SDK to create an augmented reality real...Occlusion detection and virtual object manipulation in augmented reality with the Microsoft KinectAugmented reality (AR) is limited by how you can interact with the virtual object displayed. Currently, the object can only be moved by moving the AR marker. In this project, we used the Microsoft Kinect sensor to allow one to virtually touch and manipulate the object displayed. In order to do this, we use the skeletal tracking of the sensor to allow the user to rotate and resize the object with his hands. While doing so, the user hands will inevitably get between the virtual object and the camera. To prevent the virtual object from being displayed wrongly over the hand, the depth map of the Kinect is used to find any obstruction and block rendering of pixels under occlusion. This is realized at the GPU level, using modified Shaders. The AR system uses the Unity3D game engine to display the 3D models with a custom plugin created at the CIMMI research center to enable the AR. The plugin computes in real time the pose of the Kinect using the color image while the depth map allow occlusion detection and hands tracking. The plugin was developed with the OpenCV library which allows easy analysis of the images. This work was realized at the CIMMI research center (cimmi.qc.ca) by two interns, Alexis Legare-Julien and Renaud Simard, under the supervision of Jean-Nicolas Ouellet, Ph.D.Eng.&amp;nbsp;Here are some additional details on the project:It uses the&amp;nbsp;Kinect color image and depth map to achieve augmented reality with&amp;nbsp;occlusion and object manipulation. Without wasting time, here is the&amp;nbsp;link to the demo (April 2012):&amp;nbsp;http://youtu.be/OTmHtAaQD_c&amp;nbsp;Now the description:We work on augmented reality (AR) where a virtual&amp;nbsp;object is added to a live video stream as if it was really part of the&amp;nbsp;scene. Last year, we de</itunes:summary>
      <pubDate>Thu, 31 May 2012 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/kinect/Occlusion-detection-and-virtual-object-manipulation-with-the-Kinect</guid>
      <dc:creator>Greg Duncan</dc:creator>
      <category>coding4fun</category>
      <category>kinect</category>
      <category>kinectsdk</category>
  </item>
  <item>
      <title>There are no clouds when raytracing with Azure</title>
      <description><![CDATA[<p>Today's project is something that I've found cool for years, since my Amiga days, where raytracing was 'the thing'. Today's project takes takes raytracing and moves it into the Azure cloud...</p><h2><a href="http://blogs.msdn.com/b/eternalcoding/archive/2012/01/11/use-the-power-of-azure-to-create-your-own-raytracer.aspx" target="_blank">Use the power of Azure to create your own raytracer</a></h2><blockquote><p>The power available in the <strong>cloud</strong> is growing every day. So I decided to use this raw CPU power to write a small <strong>raytracer</strong>.</p><p>I’m certainly not the first one to have had this idea as for example Pixar or <a href="http://www.greenbutton.net/">GreenButton</a> already use Azure to render pictures.</p><p>During this article, we will see how to write our own rendering system using Azure in order to be able to realize your own 3D rendered movie.</p><p>The article will be organized around the following axis:</p><ol><li><a href="http://blogs.msdn.com/b/eternalcoding/archive/2012/01/11/#c1">Prerequisites</a> </li><li><a href="http://blogs.msdn.com/b/eternalcoding/archive/2012/01/11/#c2">Architecture</a> </li><li><a href="http://blogs.msdn.com/b/eternalcoding/archive/2012/01/11/#c3">Deploying to Azure</a> </li><li><a href="http://blogs.msdn.com/b/eternalcoding/archive/2012/01/11/#c4">Defining a scene</a> </li><li><a href="http://blogs.msdn.com/b/eternalcoding/archive/2012/01/11/#c5">Web server and workers roles</a> </li><li><a href="http://blogs.msdn.com/b/eternalcoding/archive/2012/01/11/#c6">How it works?</a> </li><li><a href="http://blogs.msdn.com/b/eternalcoding/archive/2012/01/11/#c7">JavaScript client</a> </li><li><a href="http://blogs.msdn.com/b/eternalcoding/archive/2012/01/11/#c8">Conclusion</a> </li><li><a href="http://blogs.msdn.com/b/eternalcoding/archive/2012/01/11/#c9">To go further</a> </li></ol><p><a href="http://www.catuhe.com/msdn/azure/azureraytracer.zip">The final solution can be downloaded here</a> and if you want to see the final result, please go there: <a href="http://azureraytracer.cloudapp.net/">http://azureraytracer.cloudapp.net/</a></p></blockquote><p>To get started there's just a very pre-req's;</p><blockquote><h3><a>Prerequisites</a></h3><p>To be able to use the project, you must have:</p><ul><li>a Visual Studio 2010 version (Express version is supported): <a href="http://www.microsoft.com/visualstudio/en-us/products/2010-editions">http://www.microsoft.com/visualstudio/en-us/products/2010-editions</a> </li><li>Windows Azure SDK: <a href="http://www.windowsazure.com/en-us/develop/downloads/">http://www.windowsazure.com/en-us/develop/downloads/</a> </li></ul><p>You will also need an Azure account. You can get a free one just there: <a href="http://www.windowsazure.com/en-us/pricing/free-trial/">http://www.windowsazure.com/en-us/pricing/free-trial/</a></p></blockquote><p>What is the big picture of this project?</p><blockquote><h3><a>Architecture</a></h3><p>Our architecture can be defined using the following schema:</p><p>&nbsp;</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B2%5D-49.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb-48.png" alt="image" width="639" height="407" border="0"></a></p></blockquote><p>While you can play with the instance David is already running, having your own, where you can tweak it to your hearts content is key. The good news is that this article walks you through all the steps to deploy the solution to your own Azure instance.</p><blockquote><h3><a>Deploying to Azure</a></h3><p>After opening the solution, you will be able to launch it directly from Visual Studio inside the Azure Emulator. You will be so able to debug and fine tune your code before sending it to the production stage.</p><p>Once you’re ready, you can deploy your package on your Azure account using the following procedure:</p><ul><li>Open the <em>“AzureRaytracer.sln</em>”<em> </em>solution inside Visual Studio </li><li>Configure your Azure account: to do so, right click on the “<em>AzureRaytracer</em>” project and choose “Publish” menu. You will get the following screen: </li></ul><p>...</p></blockquote><p>Once he gets you online, he then describes the schema of the XML file he's using to define the scene that the code we draw.</p><blockquote><h3><a>Defining a scene</a></h3><p>To define a scene, you have to specify it using an xml file. Here is a sample scene:</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/SNAGHTML52db9fda%5B3%5D.png" target="_blank"><img title="SNAGHTML52db9fda" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/SNAGHTML52db9fda_thumb.png" alt="SNAGHTML52db9fda" width="650" height="280" border="0"></a></p><p>The file structure is the following:</p><ul><li>A [scene] tag is used as root tag and allows you to define the following parameters: <ul><li><em>FogStart</em> / <em>FogEnd</em> : Define the range of the fog from the camera. </li><li><em>FogColor</em> : RGB color of the fog </li><li><em>ClearColor</em> : Background RGB color </li><li><em>AmbientColor</em> : Ambient RGB </li></ul></li><li>A [objects] tag which contains the objects list </li><li>A [lights] tag which contains the lights list </li><li>A [camera] tag which define the scene camera. It is our point of view, defined by the following parameters: <ul><li>Position : Camera position (X,Y,Z) </li><li>Target : Camera target (X, Y, Z) </li></ul></li></ul><p>All objects are defined by a name and can be of one of the following type:</p><ul><li>sphere : Sphere defined by its center and radius </li><li>ground : Plane representing the ground defined by its offset from 0 and the direction of its normal </li><li>mesh : Complex object defined by a list of vertices and faces. It can be manipulated with 3 vectors:Position, Rotation and Scaling: </li></ul></blockquote><p>Now that we have our own instance, and a feeling for how scenes are created, next the makeup of the two Azure roles are covered.</p><blockquote><h3><a>Web server and worker roles</a></h3><p>The web server is running under ASP.Net and will provide two functionalities:</p><ul><li>Connection to worker roles using the queue in order to launch a rendering: </li><li>Publish a web service to expose requests progress: </li></ul><p>...</p><p>The WorkingUnit works according to the following algorithm:</p><ul><li>Loading the scene </li><li>Creating the raytracer </li><li>Generating the picture and accessing the bytes array </li><li>When the picture is rendered, we can save it in a blob and we update the job progress state </li><li>Launching the render </li></ul><p>...</p></blockquote><p>Finally the raytracer itself is discussed (and remember you get the source too all of this!)</p><blockquote><h3><a>The raytracer</a></h3><p>The raytracer is entirely written in C# 4.0 and uses TPL (Task Parallel Libray) to enable parallel code execution.</p><p>The following functionalities are supported (but as Yoda said “<strong>Obvious is the code</strong>”, so do not hesitate to browse the code):</p><ul><li>Fog </li><li>Diffuse </li><li>Ambient </li><li>Transparency </li><li>Reflection </li><li>Refraction </li><li>Shadows </li><li>Complex objects </li><li>Unlimited light sources </li><li>Antialiasing </li><li>Parallel rendering </li><li>Octrees </li></ul><p>The interesting point with a <strong>raytracer</strong> is that it is a massively parallelizable process. Indeed, a raytracer will execute strictly the same code for each pixel of the screen.</p><p>...</p></blockquote><p>Let's take a peek at the Solution.</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B6%5D-38.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B2%5D-47.png" alt="image" width="280" height="119" border="0"></a></p><p>As the article covers, there's three basic parts, the Azure Web, Worker and the raytracer.</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B10%5D-23.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B4%5D-36.png" alt="image" width="254" height="284" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B14%5D-21.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B6%5D-25.png" alt="image" width="195" height="134" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B18%5D-10.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B8%5D-21.png" alt="image" width="295" height="427" border="0"></a></p><p>What I thought kind of cool is that the raytracer was complete and had no external references at all.</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B25%5D-9.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B11%5D-10.png" alt="image" width="340" height="239" border="0"></a></p><p>So okay, you don't want to create your own instance, you just want to raytrace stuff? David's got an instance already running which you can play with.</p><p><a title="http://azureraytracer.cloudapp.net/" href="http://azureraytracer.cloudapp.net/">http://azureraytracer.cloudapp.net/</a></p><p><a href="http://azureraytracer.cloudapp.net/" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B29%5D-4.png" alt="image" width="650" height="343" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B32%5D-3.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B13%5D-7.png" alt="image" width="650" height="158" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B35%5D-6.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B14%5D-5.png" alt="image" width="650" height="277" border="0"></a></p><p>If your interested in raytracing, cloud development or just looking for some interesting code to check out, there's a little for everyone here...</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/coding4fun/rss&WT.dl=0&WT.entryid=Entry:RSSView:ada7dad4436849ffa541a05d014d7a07">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/There-are-no-clouds-when-raytracing-with-Azure</comments>
      <link>http://channel9.msdn.com/coding4fun/blog/There-are-no-clouds-when-raytracing-with-Azure</link>
      <itunes:summary>Today&#39;s project is something that I&#39;ve found cool for years, since my Amiga days, where raytracing was &#39;the thing&#39;. Today&#39;s project takes takes raytracing and moves it into the Azure cloud...Use the power of Azure to create your own raytracerThe power available in the cloud is growing every day. So I decided to use this raw CPU power to write a small raytracer.I’m certainly not the first one to have had this idea as for example Pixar or GreenButton already use Azure to render pictures.During this article, we will see how to write our own rendering system using Azure in order to be able to realize your own 3D rendered movie.The article will be organized around the following axis:Prerequisites Architecture Deploying to Azure Defining a scene Web server and workers roles How it works? JavaScript client Conclusion To go further The final solution can be downloaded here and if you want to see the final result, please go there: http://azureraytracer.cloudapp.net/To get started there&#39;s just a very pre-req&#39;s;PrerequisitesTo be able to use the project, you must have:a Visual Studio 2010 version (Express version is supported): http://www.microsoft.com/visualstudio/en-us/products/2010-editions Windows Azure SDK: http://www.windowsazure.com/en-us/develop/downloads/ You will also need an Azure account. You can get a free one just there: http://www.windowsazure.com/en-us/pricing/free-trial/What is the big picture of this project?ArchitectureOur architecture can be defined using the following schema:&amp;nbsp;While you can play with the instance David is already running, having your own, where you can tweak it to your hearts content is key. The good news is that this article walks you through all the steps to deploy the solution to your own Azure instance.Deploying to AzureAfter opening the solution, you will be able to launch it directly from Visual Studio inside the Azure Emulator. You will be so able to debug and fine tune your code before sending it to the production stage.Once yo</itunes:summary>
      <pubDate>Wed, 30 May 2012 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/There-are-no-clouds-when-raytracing-with-Azure</guid>
      <dc:creator>Greg Duncan</dc:creator>
      <category>csharp</category>
      <category>coding4fun</category>
      <category>windows+azure</category>
  </item>
  <item>
      <title>Kinect Unity game to help reduce impact of dyslexia</title>
      <description><![CDATA[<p>Today's inspirational project shows how teams are looking to use the Kinect to help change the world (for a few at least). one interesting point was that this project used a product we've mentioned previously, <a href="http://channel9.msdn.com/coding4fun/kinect/ZDK--Zigfu-Development-Kit--Commercial-Kinect-Development-library-for-Unity3D-and-JavaScript" target="_blank">ZDK = Zigfu Development Kit = Commercial Kinect Development library for Unity3D and JavaScript</a></p><h2>Monster Mixer - Medialogy Aalborg University P2 2012 - Kinect Unity game for dyslexia</h2><blockquote><p>Monster Mixer is a game made by students from the 2nd semester of Medialogy, Aalborg University.</p><p>TARGET GROUP: Danish kids age 6-8</p><p>PROBLEM STATEMENT: How can Kinect be used in order to create a game that reduces the impact of dyslexia by training phonological awareness?</p><p>Monster Mixer is a Kinect game developed using Unity game engine. Its purpose is to raise children's phonological awareness and thereby preventing dyslexia that they might develop in the future.</p><p>The game uses monsters and nonsense words to train phonological awareness. It requires gestures to catch monsters. The goal is to combine the right monsters into a new monster/sound. Nonsense words are used to make it impossible for the kids to just recognize already-known words.</p><p>...</p><p>We used the Zigfu Unity wrapper to make Kinect work with the Unity engine.</p></blockquote><p><strong>Project Information URL: </strong><a title="http://www.3dbuzz.com/vbforum/showthread.php?192900-Monster-Mixer-a-Unity-Kinect-game-my-university-group-have-made" href="http://www.3dbuzz.com/vbforum/showthread.php?192900-Monster-Mixer-a-Unity-Kinect-game-my-university-group-have-made">http://www.3dbuzz.com/vbforum/showthread.php?192900-Monster-Mixer-a-Unity-Kinect-game-my-university-group-have-made</a></p><p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/IvJCYEHPmIE&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/IvJCYEHPmIE&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p><p><a href="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image%5B2%5D-122.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image_thumb-118.png" alt="image" width="520" height="298" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image%5B11%5D-32.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image_thumb%5B3%5D-35.png" alt="image" width="520" height="276" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image%5B5%5D-86.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image_thumb%5B1%5D-93.png" alt="image" width="520" height="299" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image%5B14%5D-18.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/f1dda9cc6de74512b7c19f0101402403/image_thumb%5B4%5D-19.png" alt="image" width="520" height="282" border="0"></a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/coding4fun/rss&WT.dl=0&WT.entryid=Entry:RSSView:364e7c22cfdd44239d7da05d01660fae">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/kinect/Kinect-Unity-game-to-help-reduce-impact-of-dyslexia</comments>
      <link>http://channel9.msdn.com/coding4fun/kinect/Kinect-Unity-game-to-help-reduce-impact-of-dyslexia</link>
      <itunes:summary>Today&#39;s inspirational project shows how teams are looking to use the Kinect to help change the world (for a few at least). one interesting point was that this project used a product we&#39;ve mentioned previously, ZDK = Zigfu Development Kit = Commercial Kinect Development library for Unity3D and JavaScriptMonster Mixer - Medialogy Aalborg University P2 2012 - Kinect Unity game for dyslexiaMonster Mixer is a game made by students from the 2nd semester of Medialogy, Aalborg University.TARGET GROUP: Danish kids age 6-8PROBLEM STATEMENT: How can Kinect be used in order to create a game that reduces the impact of dyslexia by training phonological awareness?Monster Mixer is a Kinect game developed using Unity game engine. Its purpose is to raise children&#39;s phonological awareness and thereby preventing dyslexia that they might develop in the future.The game uses monsters and nonsense words to train phonological awareness. It requires gestures to catch monsters. The goal is to combine the right monsters into a new monster/sound. Nonsense words are used to make it impossible for the kids to just recognize already-known words....We used the Zigfu Unity wrapper to make Kinect work with the Unity engine.Project Information URL: http://www.3dbuzz.com/vbforum/showthread.php?192900-Monster-Mixer-a-Unity-Kinect-game-my-university-group-have-made</itunes:summary>
      <pubDate>Wed, 30 May 2012 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/kinect/Kinect-Unity-game-to-help-reduce-impact-of-dyslexia</guid>
      <dc:creator>Greg Duncan</dc:creator>
      <category>coding4fun</category>
      <category>kinect</category>
      <category>kinectsdk</category>
  </item>
  <item>
      <title>HTML5 Platformer game PhoneGap&#39;ed onto Windows Phone 7.1(5)</title>
      <description><![CDATA[<p>Today's Mobile Monday takes us to a project type that I've not covered before, using <a href="http://phonegap.com/" target="_blank">PhoneGap</a> (aka Cordova) to build Windows Phone 7.1(5) apps. The promise of PhoneGap is that you can write a single app and deploy it to many different phone platforms, from iOS to Android and Windows Phone 7.</p><p>That's cool, what's even cooler is that this project takes a HTML5 project we've covered before,<a href="http://channel9.msdn.com/coding4fun/blog/XNA-Platformer-HTML5-Style" target="_blank">XNA Platformer, HTML5 Style</a> and using the magic of PhoneGap puts it on Windows Phone...</p><h2><a href="http://www.codeproject.com/Articles/347777/How-to-create-HTML5-apps-on-Windows-Phone-with-Pho" target="_blank">How to create HTML5 apps on Windows Phone with PhoneGap</a></h2><blockquote><p>We will first see in this article what the added values of PhoneGap for HTML5 applications are. We’ll then discover how to create our very first project where we will retrieve the accelerometer’s values from our JavaScript code. At last, we will review a complete HTML5 gaming sample almost ported as-is to PhoneGap to use the accelerometer available on the Windows Phones.</p><ol><li><a href="http://blogs.msdn.com/b/davrous/archive/2011/12/23/tutorial-how-to-create-html5-applications-on-windows-phone-thanks-to-phonegap.aspx#introduction">Introduction</a> </li><li><a href="http://blogs.msdn.com/b/davrous/archive/2011/12/23/tutorial-how-to-create-html5-applications-on-windows-phone-thanks-to-phonegap.aspx#phonegap">PhoneGap: a framework filling the gap</a> </li><li><a href="http://blogs.msdn.com/b/davrous/archive/2011/12/23/tutorial-how-to-create-html5-applications-on-windows-phone-thanks-to-phonegap.aspx#firstproject">Let’s create our first PhoneGap project</a> </li><li><a href="http://blogs.msdn.com/b/davrous/archive/2011/12/23/tutorial-how-to-create-html5-applications-on-windows-phone-thanks-to-phonegap.aspx#accelero">Getting the accelerometer’s values from JavaScript</a> </li><li><a href="http://blogs.msdn.com/b/davrous/archive/2011/12/23/tutorial-how-to-create-html5-applications-on-windows-phone-thanks-to-phonegap.aspx#html5platformer">Review of a complete sample with the HTML5 Platformer game</a><ol><li>Forcing the landscape orientation </li><li>Handling various resolutions </li><li>Loading the levels with calls to the file system instead of using XHR </li><li>Modification of the gameplay to use the accelerometer </li><li>Screenshots of the result and FPS on some phones </li><li>Complete Visual Studio Solution to download </li></ol></li><li><a href="http://blogs.msdn.com/b/davrous/archive/2011/12/23/tutorial-how-to-create-html5-applications-on-windows-phone-thanks-to-phonegap.aspx#conclusion">Conclusion</a> </li></ol></blockquote><p>The article provides a good getting started guide and gets you quickly up and running with PhoneGap. One thing to note is that the PhoneGap project moves very fast. The current version is v1.7.0 and while this article is only a few months old it's on v1.3.0. The good news is that everything pretty much works, no matter the version.</p><blockquote><h4>PhoneGap: a framework filling the gap</h4><p>While waiting on real standardized specifications, we don’t have the choice: we need to create some <strong>bridges between JavaScript and the native code</strong> of the targeted platform to have access to its capabilities. The idea is then the following one: taking the native languages of each platform (C#, Objective-C and Java) and creating a framework with these languages that will expose interfaces to the JavaScript developer.</p><p>This is exactly what <a href="http://phonegap.com/">PhoneGap</a> is doing. Let’s take the Windows Phone case which is the main topic of this article. A Windows Phone’s PhoneGap project is simply a Silverlight application hosting the WebBrowser control (and thus IE9) as well as a Silverlight Assembly written in C# which does the job to access to the accelerometer, GPS, contacts, camera and so on. In this way, as a JavaScript developer, you will use a DLL named <strong>WP7GapClassLib.dll</strong> (the PhoneGap core runtime) without even knowing it via the usage of the code embedded in the <strong>phonegap-1.3.0.js </strong>file. This DLL contains some C# code which does calls to the Silverlight runtime available on the phone. As the runtime has access to all the capabilities of the phone, the JavaScript will do also. The JavaScript library will then act as a gateway between both worlds. Moreover, the good point of using this library is that your code will most of the time works as-is on the PhoneGap versions of Android or iOS. PhoneGap offers then an interesting form of portability.</p><p>Please note by the way that the PhoneGap support for Windows Phone is now totally complete since the recent 1.3.0 version:</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B2%5D-48.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb-47.png" alt="image" width="498" height="407" border="0"></a></p></blockquote><p>The article then moves onto a &quot;Hello Phone&quot; app, showing you how to start your first app and how to get started using the accelerometer.</p><blockquote><h4>Let’s create our first PhoneGap project</h4><h5>Prerequisites</h5><p>Here are the very first steps you need to follow:</p><ol><li>Download the Windows Phone SDK: <a href="http://aka.ms/hp-windows-phone">Windows Phone SDK</a> </li><li>Download the last version of Phone (1.3.0 today) on their site: <a href="http://phonegap.com/">http://phonegap.com/</a> </li><li>Unzip the downloaded file </li><li>Copy the <strong>PhoneGapStarter.zip </strong>and<strong> PhoneGapCustom.zip</strong> files into <strong>\Documents\Visual Studio 2010\Templates\ProjectTemplates</strong> </li></ol><h5>File-&gt;New project</h5><p>Once the previous steps are done, you will be able to create your first PhoneGap project. Start Visual Studio 2010, select the &quot;Visual C#&quot; templates and filter them via the &quot;Gap&quot; keyword. You should then see a new type of project named <strong>PhoneGapStarter</strong>:</p><p>...</p><h4>Getting the accelerometer’s values from JavaScript</h4><p>We’re going to see here how to get the values sent back by the accelerometer (of the emulator or the real device) in a very simple way.</p><p>Open the &quot;<strong><em>index.html</em></strong>&quot; page and change its default body by this one:</p><p>...</p></blockquote><p>Then, best of all, starts talking about the port of the HTML Platformer game, including tweaking it to use accelerometer to control the movement (i.e. tilt the phone to the left to run to the left, right to run to the right).</p><blockquote><h4>Review of a complete sample with the HTML5 Platformer game</h4><p>Let’s now review a more complex sample. My idea was to start from the game I’ve written before. It’s exposed in this article: <a href="http://blogs.msdn.com/b/davrous/archive/2011/09/09/html5-platformer-the-complete-port-of-the-xna-game-to-lt-canvas-gt-with-easeljs.aspx">HTML5 Platformer: the complete port of the XNA game to &lt;canvas&gt; with EaselJS</a> . I wanted to see what I should do to make it works on the phone.</p><p>First step is to simply copy/paste the different .js, .png, .css files into the &quot;www&quot; directory and to mark them as &quot;<strong>Content</strong>&quot;. Here are the others steps to follow.</p><p>...</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B5%5D-22.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B1%5D-61.png" alt="image" width="633" height="302" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image%5B8%5D-22.png" target="_blank"><img title="image" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/image_thumb%5B2%5D-46.png" alt="image" width="398" height="385" border="0"></a></p><h5>Complete Visual Studio Solution to download</h5><p>You’ll find the <strong>complete source code of the HTML5 Platformer for PhoneGap here</strong>: <a href="http://david.blob.core.windows.net/html5/HTML5GapPlatformer.zip">HTML5GapPlatformer.zip</a></p><h4>Other useful resources</h4><ul><li><a href="http://blogs.technet.com/b/port25/archive/2011/12/19/full-support-for-phonegap-on-windows-phone-is-now-complete.aspx">Full Support for PhoneGap on Windows Phone is Now Complete!</a> </li><li><a href="http://blogs.msdn.com/b/glengordon/archive/2011/11/15/phonegap-on-windows-phone-tips.aspx">PhoneGap on Windows Phone Tips</a> from Glen Gardon who has written several very interesting tutorials to follow </li><li>Lot of good tutorials in the Wiki section of PhoneGap: <a href="http://wiki.phonegap.com/w/page/35501397/Tutorials">http://wiki.phonegap.com/w/page/35501397/Tutorials</a> </li></ul><h4>Conclusion</h4><p>PhoneGap offers interesting perspectives to help you writing applications on the phone. It lets you using your existing skills in JavaScript, HTML and CSS. PhoneGap won’t necessary cover all the scenarios currently available with the native development stack (Silverlight or XNA). But this could be something to have a look to if you’d like to capitalize on the HTML skills of one of your team. You will have to pay attention to properly identify the kind of project to work on.</p><p>You can also think about mixing both environments to create hybrid experiences: the main branch would be written using &quot;HTML5&quot; and some specific parts into native code. Using this idea, some plug-ins have been created to push a bit further the integration into the Metro UI: <a href="https://github.com/purplecabbage/phonegap-plugins/tree/master/WindowsPhone">PhoneGap Plug-ins for Windows Phone</a> . You’ll find for instance one of them allowing a JavaScript code to update the Tiles.</p><p>At last, PhoneGap and HTML5 could allow a relative portability to other platforms… with some limitations. But this is a vast subject with passionate debates that would need a complete dedicated article.</p></blockquote><p>If you're thinking about developing app's for Windows Phone 7, but are also interested in other mobile platforms and are not afraid of HTML5 and JavaScript, then you should check out PhoneGap today...</p><p>&nbsp;</p><p>Here’s a few more links you might find interesting:</p><ul><li><a href="http://phonegap.com/" target="_blank">PhoneGap</a> </li><li><a href="http://channel9.msdn.com/coding4fun/blog/XNA-Platformer-HTML5-Style" target="_blank">XNA Platformer, HTML5 Style</a> </li><li><a href="http://channel9.msdn.com/Blogs/Interoperability/Simply-create-a-PhoneGap-application-for-Windows-Phone-75-in-Visual-Studio-2010" target="_blank">Simply create a PhoneGap application for Windows Phone 7.5 in Visual Studio 2010</a> </li></ul> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/coding4fun/rss&WT.dl=0&WT.entryid=Entry:RSSView:256774446dcd4aac9af4a05d013dffb8">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/blog/HTML5-Platformer-game-PhoneGaped-onto-Windows-Phone-715</comments>
      <link>http://channel9.msdn.com/coding4fun/blog/HTML5-Platformer-game-PhoneGaped-onto-Windows-Phone-715</link>
      <itunes:summary>Today&#39;s Mobile Monday takes us to a project type that I&#39;ve not covered before, using PhoneGap (aka Cordova) to build Windows Phone 7.1(5) apps. The promise of PhoneGap is that you can write a single app and deploy it to many different phone platforms, from iOS to Android and Windows Phone 7.That&#39;s cool, what&#39;s even cooler is that this project takes a HTML5 project we&#39;ve covered before,XNA Platformer, HTML5 Style and using the magic of PhoneGap puts it on Windows Phone...How to create HTML5 apps on Windows Phone with PhoneGapWe will first see in this article what the added values of PhoneGap for HTML5 applications are. We’ll then discover how to create our very first project where we will retrieve the accelerometer’s values from our JavaScript code. At last, we will review a complete HTML5 gaming sample almost ported as-is to PhoneGap to use the accelerometer available on the Windows Phones.Introduction PhoneGap: a framework filling the gap Let’s create our first PhoneGap project Getting the accelerometer’s values from JavaScript Review of a complete sample with the HTML5 Platformer gameForcing the landscape orientation Handling various resolutions Loading the levels with calls to the file system instead of using XHR Modification of the gameplay to use the accelerometer Screenshots of the result and FPS on some phones Complete Visual Studio Solution to download Conclusion The article provides a good getting started guide and gets you quickly up and running with PhoneGap. One thing to note is that the PhoneGap project moves very fast. The current version is v1.7.0 and while this article is only a few months old it&#39;s on v1.3.0. The good news is that everything pretty much works, no matter the version.PhoneGap: a framework filling the gapWhile waiting on real standardized specifications, we don’t have the choice: we need to create some bridges between JavaScript and the native code of the targeted platform to have access to its capabilities. The idea is then the followi</itunes:summary>
      <pubDate>Mon, 28 May 2012 13:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/blog/HTML5-Platformer-game-PhoneGaped-onto-Windows-Phone-715</guid>
      <dc:creator>Greg Duncan</dc:creator>
      <category>coding4fun</category>
      <category>html5</category>
      <category>windows+phone</category>
      <category>windows-phone-7</category>
  </item>
  <item>
      <title>Project Detroit: Lighting System</title>
      <description><![CDATA[<p>In this article, we give a detailed look into the external lighting system of Project Detroit, the Microsoft-West Coast Custom Mustang creation. If you're not already familiar with this project, you can find more <a href="http://channel9.msdn.com/Blogs/Vector/The-400-horsepower-device">information here</a>.</p><h2>Overview</h2><p>The external lighting system for Project Detroit is run on a web server on a Netduino Plus, which uses the .NET Micro Framework (NETMF). To get an accelerated start, we leveraged code from the CodePlex project <a href="http://netduinohelpers.codeplex.com/">Netduino Helpers</a> to control the <a href="http://www.adafruit.com/products/306">AdaFruit LPD8806 LED</a> strip, and the <a href="http://forums.netduino.com/index.php?/topic/575-updated-web-server/">web server base code from the Netduino forums</a>. They have been tweaked slightly for our project.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/netduino%5B8%5D.jpg"><img title="netduino" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/netduino_thumb%5B3%5D.jpg" alt="netduino" width="500" height="375" border="0"></a></p><h2>Controllers, Routes, RESTful oh my!</h2><p>We wanted the NETMF web server to have the exact same routes as the full-blown REST service layer in Detroit. With compiler conditionals, this allowed the same code to use the same routes on both the full .NET stack and NETMF. Since we couldn't use the ASP.NET MVC framework here, we had to make something close to it.</p><h2>Controllers</h2><p>Controllers implement an interface with a method named <strong>ExecuteAction</strong>. When <strong>GetController</strong> is called, we return the correct controller but cast as the interface <strong>IController</strong>. This lets us figure out what controller should be executing the request and continue to work generically in the context of the request connection thread. If new functionality is needed, we create a new controller that inherits from IController&nbsp;and update GetController:</p><p><pre class="brush: csharp">
private static void RequestReceived(Request request)
{
    // url comes in as /foo/bar/12345?style=255
    //
     // /CONTROLLER/ACTION/
    //
    // LIGHTING SAMPLE URL: /0/1/?r=255&amp;g=255&amp;b=255&amp;zone=EnumAsInt
    // /0/... 0 = NetduinoControllerType.Lighting
    var validResponse = false;
    try
    {
        Logger.WriteLine(&quot;Start: &quot; &#43; request.Url &#43; &quot; at &quot; &#43; DateTime.Now);
        var urlInParts = request.Url.TrimStart(UriPathSeparator).Split(new[] {'?'}, 2);
        string[] uriSubParts = null;
        string[] queryStringSubParts = null;
        if (urlInParts.Length &gt; 0)
            uriSubParts = urlInParts[0].Split(UriPathSeparator);
                
        if (urlInParts.Length &gt; 1)
            queryStringSubParts = urlInParts[1].Split(QueryStringSeparator);
        if (uriSubParts != null &amp;&amp; uriSubParts.Length &gt; 1)
        {
            var targetController = GetController(uriSubParts[0]);
            if (targetController != null)
            {
                var action = (uriSubParts.Length &gt;= 2) ? uriSubParts[1] : string.Empty;
                var result = targetController.ExecuteAction(action, queryStringSubParts);
                validResponse = true;
                request.SendResponse(result.ToString());
                Logger.WriteLine(&quot;Result: &quot; &#43; result &#43; &quot; from &quot; &#43; request.Url &#43; &quot; at &quot; &#43; DateTime.Now);
            }
        }
        if (!validResponse)
        {
            SendIndexHtml(request);
        }
    }
    catch(Exception ex0)
    {
        Logger.WriteLine(ex0.ToString());
    }
}
</pre></p><h2>Routes, strings and enums on NETMF</h2><p>NETMF can't parse an enum from a string, which is something that can be done in the full .NET Framework. But what does this actually mean? It means the routes for the NETMF web server are a bit unreadable. Here is the same route but with the parsing issue exposed:</p><p><strong>Detroit's REST service route with ASP.NET MVC:</strong><br>http://…/Lighting/Solid/?zone=all&amp;r=255&amp;g=0&amp;b=0<br><br><strong>Detroit's NETMF route:<br></strong>http://…/0/3/?zone=0&amp;r=255&amp;g=0&amp;b=0</p><p>This issue made direct device debugging a bit harder.</p><h2>Parsing the Action and query string</h2><p>Parsing the route is broken into two parts. The first is determines what controller to target. For Project Detroit, that meant the lighting system or the rear glass system. Once we know the controller, we still need to parse the query string and action into something more useful:</p><p><pre class="brush: csharp">
#if NETMF
private static readonly char[] QueryStringParamSeparator = new[] { '=' };
public static LightingData ParseQueryStringValues(string action, params string[] queryStringParameters)
#else
public static LightingData ParseQueryStringValues(string action, Dictionary&lt;string, object&gt; queryStringParameters)
#endif
{
    var data = new LightingData {LightingZone = LightingZoneType.All, LightingAction = ParseLightingActionType(action)};
#if NETMF
    if (queryStringParameters != null)
    {
        foreach (var queryString in queryStringParameters)
        {
            var valueKey = queryString.Split(QueryStringParamSeparator);
            if (valueKey.Length != 2)
                continue;
            var key = valueKey[0];
            var value = valueKey[1];
#else
        foreach(var key in queryStringParameters.Keys)
        {
            var value = queryStringParameters[key].ToString();
#endif
            switch (key.ToLower())
            {
                case ZoneHuman:
                case ZoneComputer:
                    data.LightingZone = ParseLightingZoneType(value);
                    break;
                // more stuff
            }
        }
#if NETMF
    }
#endif
    // more stuff
            
    return data;
}
</pre></p><h2>Turning on the lights</h2><p>Individually addressable LED strips allow us to tell each individual LED what color to be. To adjust the colors of the LED lights, we loop through all the LEDs, set their color value, and then call <strong>LedRefresh()</strong> on our LED strip. There's no need to set all of them, only the ones being updated:</p><p><pre class="brush: csharp">
private static void SolidAnimationWorker()
{
    var leds = GetLedsToIlluminate();
    var dataCopy = _data;
    for (var i = 0; i &lt; leds.Length; i&#43;&#43;)
        SetLed(leds[i], dataCopy.Red, dataCopy.Green, dataCopy.Blue);
    LedRefresh();
}
</pre></p><h2>Zones / Animation Threads</h2><p>A solid color is boring, but we can use procedural animations to add some flair. The current code&nbsp;supports the following animations:</p><ul><li>Solid - A single solid color. </li><li>Fill - Goes from black to the desired color. The color stays lit. Much like filling a glass of liquid. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /> </li><li>Random - LEDs are set to a random value. </li><li>Pulse - A glowing effect from bright to black. </li><li>Snake - A one way lighting effect with a fading tail that moves left to right. </li><li>Sweep - This effect was inspired by KITT and a Cylon robot and is similar to a snake pattern. The effect can also handle being split in two while maintaining a continual line for items such as the grill or the wheels. </li><li>Police - Each side flashes a red and blue light. </li></ul><p>Since we know the LED strip is a single strand, we can be clever with offsets and create groupings. By having a dedicated animation thread in each zone, we can have the grill of the car in Police Mode while the bottom fades to red and the vents fill to blue at different refresh rates.</p><p>To run an animation, we need to first kill the old animation thread, spin up a new thread, mark LEDs in the &quot;All LED&quot; zone as do not touch, and execute the new pattern. Without a way to mark the LEDs as &quot;bad&quot; in the &quot;All&quot; zone, the two animation threads would compete for setting the color and result in a flickering effect. Other zones don't have to worry about this since there is zero overlap of LEDs:&nbsp;</p><p><pre class="brush: csharp">
public bool ExecuteAction(string action, params string[] queryStringParameters)
{
    var data = LightingDataHelper.ParseQueryStringValues(action, queryStringParameters);
            
    SignalToEndAnimationThread(data.LightingZone);
    int counter = 0;
    while (counter&#43;&#43; &lt; 5 &amp;&amp; IsThreadAlive(data.LightingZone))
        Thread.Sleep(10);
    if (IsThreadAlive(data.LightingZone))
        AbortAnimationThread(data.LightingZone);
    // moving data bucket into public so new threads can leverage it
    _data = data;
    if (_data.LightingAction == LightingActionType.Police || _data.LightingAction == LightingActionType.Sweep)
    {
        _data.LightingZone = LightingZoneType.Grill;
        if (IsThreadAlive(_data.LightingZone))
            AbortAnimationThread(_data.LightingZone);
    }
    // cleaning up just incase
    if (data.LightingZone != LightingZoneType.All)
    {
        for (var i = 0; i &lt; _zoneAllAnimation.Length; i&#43;&#43;)
        {
            var leds = GetLedsToIlluminate();
            for (var z = 0; z &lt; leds.Length; z&#43;&#43;)
            {
                // flagging item as bad in animation lib
                if (_zoneAllAnimation[i] == leds[z])
                    _zoneAllAnimation[i] = -1;
            }
        }
    }
    switch (_data.LightingAction)
    {
        case LightingActionType.Solid:
            Debug.Print(&quot;Solid&quot;);
            ExecuteThread(SolidAnimationWorker);
            break;
        // more patterns
    }
    return true;
}
</pre></p><p>We can now do something more interesting, like Police Mode:</p><p><pre class="brush: csharp">
private static void PoliceModeAnimationWorker()
{
    var leds = GetLedsToIlluminate();
    var dataCopy = _data;
    var length = leds.Length;
    var half = length / 2;
    var index = 0;
    while (IsThreadSignaledToBeAlive(dataCopy.LightingZone))
    {
        int redIntensity = (index == 0) ? 255 : 0;
        int blueIntensity = (index == 0) ? 0 : 255;
        for (var i = 0; i &lt; half; i&#43;&#43;)
            SetLed(leds[i], redIntensity, 0, 0);
        for (var i = half; i &lt; length; i&#43;&#43;)
            SetLed(leds[i], 0, 0, blueIntensity);
        LedRefresh();
        index&#43;&#43;;
        index %= 2;
        Thread.Sleep(100);
    }
}
</pre></p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/WP_000197%5B5%5D.jpg"><img title="WP_000197" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/WP_000197_thumb%5B2%5D.jpg" alt="WP_000197" width="500" height="375" border="0"></a></p><h2>Improvements</h2><p>Hindsight is 20/20. Nothing is ever perfect and there are of course items we'd love to change. At the start, the goal was to make this fairly generic and not Project Detroit &quot;aware.&quot; As you can see by looking at the source, that wasn't accomplished due to time constraints.</p><p>We would use a different LED system for two reasons: data transfer speed and power. The longer the LED strip is, the longer it takes to address an item further down the line. Project Detroit, having 15 meters of lighting in it, was impacted by this issue. It works well, just not as well as we hoped. The voltage requirements of the LEDs are another consideration. They are 5V, while a car uses 12V. Had we used 12V LEDs, our wiring would have been far simpler and wouldn't have required multiple transformers to get the required amperage needed at the correct voltage.</p><h2>Conclusion</h2><p>We think the lighting solution, coupled with the time and material constraints, worked out pretty well.&nbsp; Project Detroit was a ton of fun to build out and working with West Coast Customs was the chance of a lifetime.</p><p><img src="http://files.channel9.msdn.com/thumbnail/09615539-1a33-49f7-b438-ca1b9543d712.jpg" alt="" width="500" height="284"></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/coding4fun/rss&WT.dl=0&WT.entryid=Entry:RSSView:f6bef172711342dbbca9a046016a6843">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Project-Detroit-Lighting-System</comments>
      <link>http://channel9.msdn.com/coding4fun/articles/Project-Detroit-Lighting-System</link>
      <itunes:summary>In this article, we give a detailed look into the external lighting system of Project Detroit, the Microsoft-West Coast Custom Mustang creation. If you&#39;re not already familiar with this project, you can find more information here.OverviewThe external lighting system for Project Detroit is run on a web server on a Netduino Plus, which uses the .NET Micro Framework (NETMF). To get an accelerated start, we leveraged code from the CodePlex project Netduino Helpers to control the AdaFruit LPD8806 LED strip, and the web server base code from the Netduino forums. They have been tweaked slightly for our project.Controllers, Routes, RESTful oh my!We wanted the NETMF web server to have the exact same routes as the full-blown REST service layer in Detroit. With compiler conditionals, this allowed the same code to use the same routes on both the full .NET stack and NETMF. Since we couldn&#39;t use the ASP.NET MVC framework here, we had to make something close to it.ControllersControllers implement an interface with a method named ExecuteAction. When GetController is called, we return the correct controller but cast as the interface IController. This lets us figure out what controller should be executing the request and continue to work generically in the context of the request connection thread. If new functionality is needed, we create a new controller that inherits from IController&amp;nbsp;and update GetController:
private static void RequestReceived(Request request)
{
    // url comes in as /foo/bar/12345?style=255
    //
     // /CONTROLLER/ACTION/
    //
    // LIGHTING SAMPLE URL: /0/1/?r=255&amp;amp;g=255&amp;amp;b=255&amp;amp;zone=EnumAsInt
    // /0/... 0 = NetduinoControllerType.Lighting
    var validResponse = false;
    try
    {
        Logger.WriteLine(&amp;quot;Start: &amp;quot; &amp;#43; request.Url &amp;#43; &amp;quot; at &amp;quot; &amp;#43; DateTime.Now);
        var urlInParts = request.Url.TrimStart(UriPathSeparator).Split(new[] {&#39;?&#39;}, 2);
        string[] uriSubParts = null;
        stri</itunes:summary>
      <pubDate>Mon, 21 May 2012 16:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Project-Detroit-Lighting-System</guid>
      <dc:creator>Brian Peek, Clint Rutkas, Dan Fernandez</dc:creator>
      <category>netmf</category>
      <category>project+detroit</category>
  </item>
  <item>
      <title>Project Detroit: An Overview</title>
      <description><![CDATA[<p>In this article, we will give an overview of the technical side of Project Detroit, the Microsoft-West Coast Custom Mustang creation. If you're not already familiar with this project, you can find more <a href="http://channel9.msdn.com/Blogs/Vector/The-400-horsepower-device">information here</a>.&nbsp;</p><h2>Key Design Decisions</h2><p>It’s important to keep in mind that this car was built for a TV show with a set schedule. As a result, there are a number of unique design decisions that came into play.</p><p><img src="http://files.channel9.msdn.com/thumbnail/09615539-1a33-49f7-b438-ca1b9543d712.jpg" alt=""></p><p><strong>Schedule<br><br></strong>Working backwards, the reveal for the car was set for Monday November 28, 2011 at the Microsoft Store in Bellevue, Washington. We started the project in early August, which gave us approximately 12 weeks for research, development, vehicle assembly, and testing. This was by far the #1 design decision as any ideas or features for the car had to be implemented by the reveal date.</p><p><strong>Off the Shelf Parts<br><br></strong>Another key design decision was to, where possible, use off-the-shelf hardware and software in order to allow&nbsp; interested developers to build and reuse some of the subsystems for their own car (at least the ones that don’t require welding). For example, instead of buying pricey custom sized displays for the instrument cluster or passenger display, we used stock <a href="http://www.microsoftstore.com/store/msstore/pd/Samsung-Series-7-Slate/productID.241554200/vip.true">Samsung Series 7 Slate</a> PCs and had West Coast Customs do the hard work of building a custom dash to hold the PC.</p><p>&nbsp;</p><h2>Hardware and Networking</h2><p>The car is packed with a variety of computers and networking hardware.</p><ul><li><strong>Instrument Cluster Slate</strong> – This slate is on the driver's side and manages the instrument cluster application and the On-Board Diagnostic (OBD) connection to read telemetry data from the car. </li><li><strong>Passenger Slate – </strong>This slate, which is built into the passenger's side, runs a custom Windows 8 application (see Passenger slate below). <br><img title="USA_" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/Built-In_Touch_screen_Displays_Web_thumb%5B1%5D.jpg" alt="USA_" width="324" height="212" border="0"> </li><li><strong>Laptop 1 – </strong>This laptop runs the REST service to control different parts of the car, the Kinect socket service for the front Kinect, and the user message service to display messages on the rear glass while driving. </li><li><strong>Laptop 2 </strong>– This laptop runs the Heads Up Display (HUD) service, the Kinect socket service for the back Kinect, the OBD-II database, and Azure services. </li><li><strong>Windows Phone – </strong>A Nokia Lumia 800 connects via WiFi and a custom Windows Phone 7 application (See Windows Phone application below). </li><li><strong>Xbox 360 – </strong>The Xbox 360 displays on either the passenger HUD or the rear glass display. </li><li><strong>Networking</strong> – A <a href="http://www.netgear.com/home/products/wirelessrouters/high-performance/wndr3700.aspx">NETGEAR N600/WNDR3700</a> wireless router provides wired and wireless access for everything in the car, which is used in conjunction with a Verizon USB network card plugged into a <a href="http://www.cradlepoint.com/products/small-business-home-office-routers/mbr900-cellular-router">Cradle Point MBR900</a> to provide an always-on 3G/4G LTE internet connection. The slates, laptops, and Xbox 360 are connected via CAT5e cable, while the Windows Phone 7 connects via WiFi. </li></ul><p><strong>Note: </strong>One of the limitations of the Kinect SDK is that if you have multiple Kinects plugged into one PC, only one of those Kinects can do skeletal tracking at a time (color/depth data works just fine). Because of this, we decided to have a dedicated laptop plugged into the front Kinect and another laptop plugged into the back Kinect in order to allow front and back skeletal tracking at the same time. If we'd not used simultaneous skeletal tracking, we could have combined all of the systems onto a single laptop.</p><h2>Architecture</h2><p>Here is a quick overview of the application architecture.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/detroitArch%5B7%5D-1.png"><img title="detroitArch" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/detroitArch_thumb%5B4%5D.png" alt="detroitArch" width="500" height="319" border="0"></a></p><h2>&nbsp;</h2><h2>REST Service Layer</h2><p>The REST Service Layer allowed different systems talk to one another. More importantly, it allowed different services to control hardware they normally wouldn't be able to access.</p><ol><li><strong>Thin client approach<br></strong>The solution we chose was to have all the services that control different parts of the car reside on the laptops and have client applications like the Windows Phone application send REST commands to execute an action so the service layer would execute the request. <br><br></li><li><strong>REST-enable hardware</strong> <br>Controlling hardware should be invisible to the consuming clients. For example, hardware that requires USB communication would be impossible to control with a Windows Phone. The service layer allowed us to control hardware in a way that was invisible to the end user. <br><br></li><li><strong>Helper Libraries</strong><br>To simplify communication with the service layer, we built a set of helper classes to abstract out repetitive tasks like JSON serialization/deserialization, URI building, etc. For example, to get the list of car horn “ringtones”, the client application can call <strong>HornClient.List()</strong> to get back a list of available ringtone filenames. To set the car horn, the client calls <strong>HornClient.Set(filename)</strong>, and to play the car horn, it then calls <strong>HornClient.Play(filename)</strong>. The Helper libraries were built to work on Windows 7, Windows 8, and Windows Phone 7. </li></ol><h2>OBD-II</h2><p>We have already released an <a href="http://channel9.msdn.com/coding4fun/articles/Project-Detroit-How-to-Read-Your-Cars-Engine-Data-with-OBD-II">article</a> and <a href="http://obd.codeplex.com/">library</a> on the OBD-II portion of the car.&nbsp; In short, OBD-II stands for On-Board Diagnostics. Hooking into this port allows one to query for different types of data from the car, which we use to get the current speed, RPMs, fuel level, etc. for display in the Instrument Cluster and other locations. OBD can do far more than this, but it's all we needed for our project. Please see the linked articles for further details on the OBD-II library itself.</p><p>For the car, because only one application can open and communicate with a serial port at one time, we created a WCF service that polls the OBD-II data from the car and GPS data from a <a href="http://www.microsoftstore.com/store/msstore/en_US/pd/productID.216603800">Microsoft Streets &amp; Trips GPS locator</a>, and returns it to any application that queries the service.</p><p>For the OBD library, we used a manual connection to poll different values at different intervals. For values critical to driving the car—like RPM, speed, etc.—we polled for the values as quickly as the car could return them. With other values that weren’t critical to driving the car—like the fuel level, engine coolant temperature, etc.—we polled at a 1-2 second interval. For GPS, we subscribed to the <strong>LocationChanged</strong> event, which would fire when the GPS values changed.</p><p>Rather than creating a new serial port connection for every WCF request for OBD data, we created a singleton service that is instantiated when the service first runs. Accordingly, there is only one object in the WCF service that represents the last OBD and GPS data returned, which is obtained by the continual reading of the latest OBD data using the OBD library as described above. This means that calls to the WCF service <strong>ReadMeasurement</strong> method didn’t actually compute anything, but instead serialized the last saved data and returned it via the WCF service.</p><p>Since WCF supports multiple protocols, we implemented HTTP and TCP and ensured that any WCF service options we chose worked on Windows Phone, which, for example, can only use basic HTTP bindings.</p><p>To enable the ability to change the programming model later and to simplify the polling of the service, we built a helper library for Windows and Windows Phone that abstracts all the WCF calls.</p><p>The code below creates a new <strong>ObdService</strong> class and signs up for an event when the measurement has changed. The <strong>Start</strong> method does a couple of things: it lets you set the interval that you want to poll the <strong>ObdService</strong>, in this case every second (while the instrument cluster needs fast polling, the database logger can poll once a second). It also determines what IP address the service is hosted at (localhost), the protocol (HTTP or TCP), and whether to send “demo mode” data. Since one of the main ways the car is showcased is when it’s stopped on display, “demo mode” sends fake data, instead of always returning 0's for MPH, RPM, etc., so people can see what the instrument cluster would look like in action.</p><p><pre class="brush: csharp">
_service = new ObdService();
_service.ObdMeasurementChanged &#43;= service_ObdMeasurementChanged;
_service.Start(new TimeSpan(0, 0, 0, 0, 1000), localhost, Protocol.Http, false);

void service_ObdMeasurementChanged(object sender, ObdMeasurementChangedEventArgs e)
{
  Debug.Writeline(&quot;MPH=” &#43; e.Measurement.MilesPerHour);
}
</pre></p><h2>OBD-II Database &amp; Azure Services</h2><p>To record and capture the car telemetry data like MPH, RPM, engine load, and throttle (accelerator) position, as well as location data (latitude, longitude, altitude, and course), we used a SQL Server Express database with a simple, flat Entity Framework model, shown below. The primary key, the <strong>ObdMeasurementID</strong> is a GUID that is returned via the <strong>ObdService</strong>.&nbsp; Just like above, the database logger subscribes to the <strong>ObdMeasurementChanged</strong> event and receives a new reading at the time interval set in the <strong>Start()</strong> method.</p><p><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image%5B7%5D-3.png" alt="image" width="319" height="522" border="0"></p><p>The Windows Azure data model uses Azure Table Services instead of SQL Server. The data mapping is essentially the same since both have a flat schema.</p><p>For Azure Table Storage, in addition to the schema above, you also need a partition key and a row key. For the partition key, we used a custom <strong>TripID</strong> (GUID) to represent a Trip. When the car is turned on/off a new TripID is created. That way we could group all measurements for that particular trip and do calculations based on that trip, like the average miles per gallon, distance traveled, fastest speed, etc. For the row key, we used a <strong>DateTimeOffset </strong>and a custom extension method, <strong>ToEndOfDays</strong>() that provides a unique numerical string (since Azure's row key is a string type) that subtracts the time from the <strong>DateTime.</strong><strong>Max</strong> value. The result is that the earlier a <strong>DateTime</strong> value, the larger the number.</p><p>Example:</p><p>Time=5/11/2012 9:14:09 AM, EndOfDays=2520655479509478223 //larger <br>Time=5/11/2012 9:14:11 AM, EndOfDays=2520655479482804811 //smaller</p><p>Since they are ordered in reverse order, with the most recent date/time being the first row, we can write an efficient query to pull just the first row to get the current latitude/longitude without needing to scan the entire table for the last measurment.</p><pre><br><pre class="brush: csharp">
public override string RowKey
{
    get
    {
        return new DateTimeOffset(TimeStamp).ToEndOfDays();
    }
    set
    {
        //do nothing
    }
}

public static class DateTimeExtensions
{
  public static string ToEndOfDays(this DateTimeOffset source)
  {  
    TimeSpan timeUntilTheEnd = DateTimeOffset.MaxValue.Subtract(source);
    return timeUntilTheEnd.Ticks.ToString();
  }

  public static DateTimeOffset FromEndOfDays(this String daysToEnd)
  {
    TimeSpan timeFromTheEnd = newTimeSpan(Int64.Parse(daysToEnd));
    DateTimeOffset source = DateTimeOffset.MaxValue.Date.Subtract(timeFromTheEnd);
    return source;
  }
}
</pre><br><br></pre><p>To upload data to Azure, we used a timer-based background uploader that would check to see if there was an internet connection, and then filter and upload all of the local SQL Express rows that had not been submitted to Azure using the <strong>Submitted </strong>boolean database field. On the Azure side, we used an ASP.NET MVC controller to submit data. The controller deserializes the data into a <strong>List&lt;MeasurementForTransfer&gt; </strong>type, it adds the data to a blob, and adds the blob to a queue as shown below.</p><p>A worker role (or many) will then read items off the queue and the new OBD measurement rows are placed into Azure Table Storage.</p><pre><br><pre class="brush: csharp">
public ActionResult PostData()
{
    try
    {
        StreamReader incomingData = new StreamReader(HttpContext.Request.InputStream);

        string data = incomingData.ReadToEnd();
        JavaScriptSerializer oSerializer =
            new JavaScriptSerializer();

        List&lt;MeasurementForTransfer&gt; measurements;
        measurements = oSerializer.Deserialize(data, typeof(List&lt;MeasurementForTransfer&gt;)) as List&lt;MeasurementForTransfer&gt;;

        if (measurements != null)
        {
            CloudBlob blob = _blob.UploadStringToIncoming(data);
            _queue.PushMessageToPostQueue(blob.Uri.ToString());
            return new HttpStatusCodeResult(200);
        }
        ...
    }
}
</pre><br><br></pre><h2>Instrument Cluster</h2><p>Much of this is also covered in our previously released OBD-II library where the instrument cluster application is included as a sample. This is a WPF application that runs on a Windows 7 slate. It contains three different skins designed by <a href="www.352media.com">352 Media</a>—a 2012 Mustang dashboard, a 1967 Mustang dashboard, and a Metro-style dashboard—each of which can be &quot;swiped&quot; through. This application queries the OBD-II WCF service described above as quickly as it can to retrieve speed, RPM, fuel level, and other data for display to the driver. The gauges are updated in real-time just as a real dashboard instrument cluster would behave.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/obd1%5B2%5D.png"><img title="obd1" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/obd1_thumb.png" alt="obd1" width="244" height="139" border="0"></a><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/obd2%5B2%5D.png"><img title="obd2" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/obd2_thumb.png" alt="obd2" width="244" height="139" border="0"></a><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/obd3%5B2%5D.png"><img title="obd3" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/obd3_thumb.png" alt="obd3" width="244" height="139" border="0"></a></p><h2>HUD</h2><p>The HUD (or Heads Up Display) application runs on one of the two Windows 7 computers in the car. This is a full-screen application that is output via a projector to a series of mirrors and a projection screen. This is then reflected onto the front glass of the windshield of the car. To install these, we altered the physical car's body and created brackets to mount mirrors and the projectors. In the picture on the left, you can see the dashboard's structural member pivoted outward. You can see the 12&quot; section we removed and added in the base plate to allow light to be reflected through to the windshield. <a href="http://twitter.com/wjsteele">Bill Steele </a>helped design and implement the physical HUD aspect into the car.</p><p><iFrame src="http://channel9.msdn.com/posts/Project-Detroit-Hud/player?w=512&amp;h=288" frameborder="0" scrolling="no" width="512px" height="288px"></iFrame></p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/alterationFrame%5B2%5D.jpg"><img title="alterationFrame" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/alterationFrame_thumb.jpg" alt="alterationFrame" width="240" height="180" border="0"></a>&nbsp;<a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/mirrors%5B2%5D.jpg"><img title="mirrors" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/mirrors_thumb.jpg" alt="mirrors" width="240" height="180" border="0"></a></p><p>The HUD application has several different modes.&nbsp; The mode is selected from the Windows Phone application.</p><ul><li><strong>POI / Mapping</strong> – This uses <a href="http://msdn.microsoft.com/en-us/library/dd877180.aspx">Bing Maps services</a>. The phone or Windows 8 passenger application can choose one of a select group of categories (Eat, Entertain, Shop, Gas). Once selected, the REST service layer is contacted and the current choice is persisted. The HUD is constantly polling the service to know what the current category is, and when it changes, the HUD switches to an overhead map display with the closest locations of that category displayed, along with your always updated current GPS position and direction. The list of closest items in the category is requested every few seconds from the Bing Maps API and the map is updated appropriately. <br><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image%5B10%5D-1.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb%5B6%5D-3.png" alt="image" width="324" height="204" border="0"></a> </li><li><strong>Car telemetry</strong> - In the car telemetry mode, the OBD data from the WCF service described above is queried and displayed on the screen.&nbsp; This can be though of as an overall car &quot;status&quot; display with the speed, RPMs, real-time MPG, time, and weather information. </li><li><strong>Weather</strong> – We use the <a href="http://www.worldweatheronline.com/">World Weather Online</a> API to get weather data for display on the HUD. This API allows queries for weather based on a latitude and longitude, which we have at all times. A quick call to the service gives us the current temperature and a general weather forecast, which we display as an icon next to the temperature in the lower-left portion of the screen. <strong><br><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image%5B5%5D-4.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb%5B3%5D-5.png" alt="image" width="324" height="204" border="0"></a></strong> </li><li><strong>Kinect</strong> – Using our <a href="http://kinectservice.codeplex.com/">Kinect Service</a>, with the standard WPF client code, we can display the rear camera on the HUD to help the driver when backing up. See the Kinect Service project for more information on how this works and to use the service in an application of your own. </li></ul><h2>&nbsp;</h2><h2>Windows Phone Application</h2><p>One of the main ways to control the vehicle is through the Windows Phone application.&nbsp; <br><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/a%5B4%5D.png"><img title="a" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/a_thumb%5B2%5D.png" alt="a" width="196" height="324" border="0"></a></p><p>The first pivot of the app allows the user to lock, unlock, start the car, and set off the alarm.&nbsp; This is done through the <a href="http://www.viper.com">Viper</a> product from <a href="http://www.directed.com">Directed Electronics</a>.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/a%5B8%5D.png"><img title="a" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/a_thumb%5B4%5D.png" alt="a" width="196" height="324" border="0"></a></p><p>The second pivot contains the remaining ways that a user can interact with the car.</p><ul><li><strong>Kinect</strong> – This uses the Kinect service much in the way the HUD does. It can display both the front and rear cameras as well as allow the user to listen to an audio clip and send it up to the car while applying a voice changing effect.<br><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/a%5B13%5D.png"><img title="a" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/a_thumb%5B7%5D.png" alt="a" width="196" height="324" border="0"></a> </li><li><strong>Voice Effect</strong> – When the Talk button is pressed, the user can record their voice via the microphone. When released, the audio data is packaged in a simple WAV file and uploaded to the REST service. The user can select from several voice effects, such as Chipmunk and Deep. On the service side, that WAV file is modified with the selected effect and then played through the PA system. The code in this section of the app is very similar to the <a href="http://skypefx.codeplex.com/">Coding4Fun Skype Voice Changer</a>. We use <a href="http://naudio.codeplex.com/">NAudio</a> and several pre-made effects to process the WAV file for play. </li><li><strong>Lighting</strong> – This controls the external lighting for the car. The user can select a zone, an animation, and a color to apply. Once selected, this is communicated through the REST service to the lighting controller.<strong><br><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/a%5B17%5D.png"><img title="a" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/a_thumb%5B9%5D.png" alt="a" width="404" height="244" border="0"></a></strong> </li><li><strong>Messaging</strong> – This presents a list of known pictures and videos for the user. The selection is sent to the car through the REST service and displayed on the projector that is pointed at the rear window, allowing following drivers to see the image, video, or message.&nbsp; </li><li><strong>Point Of Interest</strong> – As described earlier, this is the way the user can turn on the Point of Interest map on the HUD.&nbsp; Selecting one of the four items sends the selection to the REST service where it is persisted. The polling HUD will know when the selection is changed and display the map interface as shown above. </li><li><strong>Telemetry</strong> – This is a replica of the instrument cluster that runs on the Windows 7 slate. OBD data is queried via the WCF service, just like the slate, and displayed on the gauges, just like the slate.<br>&nbsp;<a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image%5B13%5D-1.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb%5B7%5D-2.png" alt="image" width="404" height="199" border="0"></a> </li><li><strong>Projection Screen</strong> – This will raise and lower the projection screen on the rear of the car. </li><li><strong>Horn</strong> – This displays a list of known horn sound effects that live on the REST service layer. Selecting any of the items will send a command through the REST to play that sound file on the external sound system of the car. This selected audio file would play when the horn was pressed in the car. </li><li><strong>Settings</strong> – Internal settings for setting up hardware and software for the car. </li></ul><h2>Passenger Application</h2><p>The passenger interface runs on a Samsung Series 7 slate running the Windows 8 Consumer Preview. This interface has a subset of the functionality provided by the Windows Phone application, but communicates through the same REST service. From this interface, the passenger can set the car horn sound effect, view the front and back Kinect cameras, select a Point of Interest category to be displayed on the HUD, and select the image, video or message that will be displayed on the rear window.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image%5B14%5D-2.png"><img title="image" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/image_thumb%5B8%5D-5.png" alt="image" width="324" height="204" border="0"></a></p><h2>External Car Lighting</h2><p>The external lighting system was controlled by a web server running on a <a href="http://netduino.com/netduinoplus/specs.htm">Netduino Plus</a> using a <a title="http://www.sparkfun.com/products/7914" href="http://www.sparkfun.com/products/7914">Sparkfun protoshield board</a> to simplify wiring, and allow for another shield to be used. The actual lights were <a href="http://www.adafruit.com/products/306">Digital Addressable RGB LED w/ PWM</a>. We'll also have a more in-depth article on this system on Coding4Fun shortly.</p><p>The car is broken down into different zones—grill, wheels, vents, etc. It also has a bunch of pre-defined procedural animation patterns that have a few adjustable parameters that allow for things like a snake effect, a sensor sweep, or even a police pattern. Each zone has its own thread which provides the ability to have multiple animation patterns going at the same time. When a command is received, the color, pattern, zone, and other data is then processed.</p><p>Here is a basic animation loop pattern.</p><p><pre class="brush: csharp">
private static void RandomAnimationWorker()
{
    var leds = GetLedsToIlluminate();
    var dataCopy = _data;
    var r = new Random();

    while (IsThreadSignaledToBeAlive(dataCopy.LightingZone))
    {
        for (var i = 0; i &lt; leds.Length; i&#43;&#43;)
            SetLed(leds[i], r.Next(255), r.Next(255), r.Next(255));

        LedRefresh();
        Thread.Sleep(dataCopy.TickDuration);
    }
}
</pre></p><h2>Rear Projection Window</h2><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/rearGlass%5B4%5D.jpg"><img title="rearGlass" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/rearGlass_thumb%5B2%5D.jpg" alt="rearGlass" width="480" height="360" border="0"></a></p><p>The rear projection system consists of <a href="http://www.trossenrobotics.com/store/p/5183-4-Inch-Stroke-110-LB-Linear-Actuator-with-Feedback.aspx">two 4” linear actuators</a>, <a href="http://www.trossenrobotics.com/store/p/5189-Dual-Linear-Actuator-Controller.aspx">a linear actual controller</a>, the NETMF web server from above, a <a href="http://www.seeedstudio.com/depot/relay-shield-p-693.html?cPath=132_134">Seeed Studio Relay Shield</a>, the back glass of a 1967 Ford Mustang, some <a href="http://www.ssidisplays.com/rear-projection-film/intrigue">rear projection film</a>, <a href="http://www.amazon.com/Casio-Green-Projector-Lumens-XJ-A250/sim/B004I36R6Q/2">a low profile yet insanely bright projector that accepts serial port commands</a>, and a standard USB to serial adapter.</p><p>The REST service layer toggles the input of the projector based on the selected state.&nbsp; This would allow us to go from the HDMI output of an Xbox 360 to the VGA output of the laptop.&nbsp; While doing this, the REST layer sends a command to the NETMF web server to either raise or lower the actuators.</p><p>Here is the code for the NETMF to control the raising and lowering the glass:</p><p><pre class="brush: csharp">
public static class Relay
{
    // code for for Electronic Brick Relay Shield
    static readonly OutputPort RaisePort = new OutputPort(Pins.GPIO_PIN_D5, false);
    static readonly OutputPort LowerPort = new OutputPort(Pins.GPIO_PIN_D4, false);

    const int OpenCloseDelay = 1000;

    public static bool Raise()
    {
        return ExecuteRelay(RaisePort);
    }

    public static bool Lower()
    {
        return ExecuteRelay(LowerPort);
    }

    private static bool ExecuteRelay(OutputPort port)
    {
        port.Write(true);
        Thread.Sleep(OpenCloseDelay);
        port.Write(false);

        return true;
    }
}
</pre></p><h2>Messaging System</h2><p>This is a WPF application that leveraged the file system on the computer to communicate between the REST service layer and itself.&nbsp; Visually, it shows the message/image/video in the rear view mirror but it actually does two other tasks, it operates our car horn system and plays the recorded audio output from the phone.</p><ul><li><strong>Displaying Messages</strong><br>To display images, we poll the REST service every second for an update.&nbsp; Depending on the return type, we either display a TextBlock element or a MediaElement.<br><br></li><li><strong>Detecting and Playing Car Horn</strong><br>When someone presses the horn in the car, it is detected by a Phidget 8/8/8 wired into a Digital Input. In-between the car horn and the Phidget, there is a relay as well. This isolates the voltage coming from the horn and solves a grounding issue. We then feed back two wires from that relay and put one into the ground and the other into one of the digital inputs. In the application, we listen to the <strong>InputChange</strong> event on the Phidget and play / stop the audio based on the state.<br><br></li><li><strong>Detecting new recorded audio from the phone and car horn changes</strong><br>When someone talks into the phone or selects a new car horn, the REST service layer places that audio file into a predetermined directory. The Messaging service then uses a <strong>FileSystemWatcher</strong> to detect when this file is added. The difference between the car horn detection and recorded audio is the recorded audio will play once it is done writing to the file system. </li></ul><h2>External PA System</h2><p>To interact with people, we installed an external audio PA or Public Address system. This system is hooked into the laptop that is connected to the car horn, and can play audio data from the phone. Having a PA system that is as simple as an audio jack that plugs into a PC enabled us to have different ringtones for the car horn and to talk through the car using Windows Phone.</p><h2>Conclusion</h2><p>After months of planning and building, the Project Detroit car was shown to the world on an episode of Inside West Coast Customs. Though it was a ton of work, the end product is something we are all proud of. We hope that this project inspires other developers to think outside the box and realize what can be done with some off-the-shelf hardware, software, and passion.</p><p><a href="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/splash%5B5%5D.jpg"><img title="splash" src="http://files.channel9.msdn.com/wlwimages/1932b237046e4743a4e79e6800c0220f/splash_thumb%5B3%5D.jpg" alt="splash" width="480" height="350" border="0"></a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/coding4fun/rss&WT.dl=0&WT.entryid=Entry:RSSView:1a2766655d5e40eb9dbea030013669f1">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Project-Detroit-An-Overview</comments>
      <link>http://channel9.msdn.com/coding4fun/articles/Project-Detroit-An-Overview</link>
      <itunes:summary>In this article, we will give an overview of the technical side of Project Detroit, the Microsoft-West Coast Custom Mustang creation. If you&#39;re not already familiar with this project, you can find more information here.&amp;nbsp;Key Design DecisionsIt’s important to keep in mind that this car was built for a TV show with a set schedule. As a result, there are a number of unique design decisions that came into play.ScheduleWorking backwards, the reveal for the car was set for Monday November 28, 2011 at the Microsoft Store in Bellevue, Washington. We started the project in early August, which gave us approximately 12 weeks for research, development, vehicle assembly, and testing. This was by far the #1 design decision as any ideas or features for the car had to be implemented by the reveal date.Off the Shelf PartsAnother key design decision was to, where possible, use off-the-shelf hardware and software in order to allow&amp;nbsp; interested developers to build and reuse some of the subsystems for their own car (at least the ones that don’t require welding). For example, instead of buying pricey custom sized displays for the instrument cluster or passenger display, we used stock Samsung Series 7 Slate PCs and had West Coast Customs do the hard work of building a custom dash to hold the PC.&amp;nbsp;Hardware and NetworkingThe car is packed with a variety of computers and networking hardware.Instrument Cluster Slate – This slate is on the driver&#39;s side and manages the instrument cluster application and the On-Board Diagnostic (OBD) connection to read telemetry data from the car. Passenger Slate – This slate, which is built into the passenger&#39;s side, runs a custom Windows 8 application (see Passenger slate below).  Laptop 1 – This laptop runs the REST service to control different parts of the car, the Kinect socket service for the front Kinect, and the user message service to display messages on the rear glass while driving. Laptop 2 – This laptop runs the Heads Up Display (HUD) se</itunes:summary>
      <pubDate>Mon, 14 May 2012 16:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Project-Detroit-An-Overview</guid>
      <dc:creator>Brian Peek, Clint Rutkas, Dan Fernandez</dc:creator>
      <category>project+detroit</category>
  </item>
  <item>
      <title>Making Mayhem with Volume Control</title>
      <description><![CDATA[<p>Why, hello there! We are going to pick up where we left off at the end of our Coding4Fun video. In the video we built a reaction that increments the volume level on the computer. We are going to expand from there to make a reaction that enables you to set the volume level to a specified volume.</p><p><iFrame src="http://channel9.msdn.com/Blogs/Clint/Project-Mayhem-Creating-a-module/player?w=512&amp;h=288" frameborder="0" scrolling="no" width="512px" height="288px"></iFrame></p><p><a href="http://media.ch9.ms/c4f/c4f/MayhemVolumeStart.zip"><strong>MayhemVolumeStart.zip file</strong></a>&nbsp;contains the class library project all set up with the NuGet package references and the reaction that increments the volume.</p><p>The first step we are going to take is to add the additional references we need to be configurable. The first reference is <strong>MayhemWpf</strong> from the same NuGet feed <strong>MayhemCore</strong> is from. (<a href="http://makemayhem.com/nuget">http://makemayhem.com/nuget</a>). Add a reference to the following assemblies:</p><ul><li><strong>PresentationCore</strong> </li><li><strong>PresentationFramework</strong> </li><li><strong>System.Runtime.Serialization</strong> </li><li><strong>System.Xaml</strong> </li><li><strong>WindowsBase</strong>. </li></ul><p>Next, we switch the code from incrementing the volume to setting the volume to 50%.</p><p>To do this, replace the line:</p><p><pre class="brush: csharp">
device.AudioEndpointVolume.VolumeStepUp();
</pre></p><p>with</p><p><pre class="brush: csharp">
device.AudioEndpointVolume.MasterVolumeLevelScalar = 50 / 100.0f;
</pre></p><p>The reaction now works successfully to set the volume to half way. The next step is to make that setting configurable, and persist between application runs. Let’s make that 50 a variable. Add a private integer to the class (I’m calling it level) and change the above line to be:</p><p><pre class="brush: csharp">
device.AudioEndpointVolume.MasterVolumeLevelScalar = level / 100.0f;
</pre></p><p>Since that variable will be user configurable, we want to be able to show a string on the main window that says what the reaction is doing. To do this, we have to tell Mayhem that our reaction is configurable by implement the <strong>IWpfConfigurable</strong> interface from <strong>MayhemWpf</strong>.</p><p>In order to set that configuration string we have to implement the method <strong>GetConfigString</strong>. The implementation of this method should return some string that provides a look into what the configuration settings are for the reaction.</p><p>I will make the <strong>GetConfigString</strong> method be the following:</p><p><pre class="brush: csharp">
public string GetConfigString()
{
   return string.Format(&quot;Set the volume to {0}%&quot;,level);
}
</pre></p><pre>&nbsp;</pre><p>Now, in order to make the module save the configured state when the application is shut down and restarted, we need to add a little bit of data contract code. We are going to add the <strong>[DataContract]</strong> attribute to our class. This attribute comes from the <strong>System.Runtime.Serialization</strong> framework.</p><p>Our class header now looks like:</p><p><pre class="brush: csharp">
[DataContract]
[MayhemModule(&quot;Set Volume&quot;, &quot;Sets the master volume level&quot;)]
public class SetVolume : ReactionBase, IWpfConfigurable
</pre></p><p>Note that I also changed the <strong>MayhemModule</strong> attribute’s name and description to reflect the new functionality.</p><p>We also need to mark the configurable variables to be saved as well. To do that, add the <strong>[DataMember]</strong> attribute to our level variable:</p><p><pre class="brush: csharp">
[DataMember]
private int level;
</pre></p><p>In order to set a default value for this variable, we shouldn’t initialize it using a constructor. Constructors should never be used in modules. Instead, we have a method that should be overridden that you get from <strong>ReactionBase</strong>. <strong>OnLoadDefaults</strong> is to load the settings you want to have by default.</p><p><pre class="brush: csharp">
protected override void OnLoadDefaults()
{
   level = 50;
}
</pre></p><p>Now when you use the <strong>SetVolume</strong> reaction in Mayhem, it will at 50%, but if that value is changed and the application is restarted, it will be set to the value it was at before it was closed!</p><p>The next step is to make the configuration window that actually enables that variable to be modified.</p><p>Add a new WPF <strong>UserControl</strong> item to the project named <strong>SetVolumeConfig.xaml</strong>.</p><p>Replace the contents of the XAML file with:</p><p><pre class="brush: xml">
&lt;src:WpfConfiguration x:Class=&quot;Volume.SetVolumeConfig&quot;
   xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
   xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;   
   xmlns:src=&quot;clr-namespace:MayhemWpf.UserControls;assembly=MayhemWpf&quot;
   Width=&quot;300&quot;&gt;
   &lt;Grid&gt;
      &lt;Grid.ColumnDefinitions&gt;
         &lt;ColumnDefinition Width=&quot;100&quot; /&gt;
         &lt;ColumnDefinition Width=&quot;200&quot; /&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;Grid.RowDefinitions&gt;
         &lt;RowDefinition /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;TextBlock Style=&quot;{StaticResource ConfigLabel}&quot; Grid.Column=&quot;0&quot; Grid.Row=&quot;0&quot;&gt;Volume:&lt;/TextBlock&gt;
      &lt;Slider Grid.Column=&quot;1&quot; Grid.Row=&quot;0&quot; Height=&quot;23&quot; HorizontalAlignment=&quot;Left&quot;  Name=&quot;VolumeSlider&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;200&quot; Maximum=&quot;100&quot; /&gt;
   &lt;/Grid&gt;
&lt;/src:WpfConfiguration&gt;
</pre></p><p>This configuration window simply has a volume slider allowing values between 0 and 100. <strong>WpfConfiguration</strong> handles the display of how the module asks for information. As you hopefully notice, it doesn’t contain the save button, or the title of the window. All that is handled for you so that we can maintain consistency between configuration windows. We also provide default styles that further maintain consistency and user expectation.</p><p>We now need to create the backing code that makes the configuration window come together. Change <strong>SetVolumeConfig.xaml.cs</strong> to extend the base class <strong>WpfConfiguration</strong> instead of the default <strong>UserControl</strong> base class.</p><p>In the constructor, we should ask for all the information we need to populate the config window with the current settings. In this situation, that only means the current volume level setting. Add an <strong>int</strong> parameter to the constructor called <strong>level</strong>. Also add a public property on the class with a private setter called <strong>Level</strong>. In the constructor, set this property with the parameter passed in to the constructor.</p><p>Your class should now look like this:</p><p><pre class="brush: csharp">
using MayhemWpf.UserControls;
namespace Volume
{
   public partial class SetVolumeConfig : WpfConfiguration
   {
      public int Level
      {
         get;
         private set;
      }
      public SetVolumeConfig(int level)
      {
         this.Level = level;
         InitializeComponent();
      }
   }
}
</pre></p><p><strong>WpfConfiguration</strong> gives us some handy hooks that we can use. We need to set the value property on our slider. This could be done with data bindings, but for simplicity we will just be doing this with code. Also, there is a <strong>Boolean</strong> flag in the <strong>WpfConfiguration</strong> class that enables the <strong>Save</strong> button on the dialog. When handling user input, the save button should only be enabled if the input is valid. Since the slider always has a value in our range, the Save button can always be enabled. We will set this flag in the <strong>OnLoad</strong> method.</p><p>Override the <strong>OnLoad</strong> method as follows:</p><p><pre class="brush: csharp">
public override void OnLoad()
{
   VolumeSlider.Value = this.Level;
   CanSave = true;
}
</pre></p><p>We then also override the <strong>OnSave</strong> method to set the property to the value the <strong>SetVolume</strong> class will expect.</p><p><pre class="brush: csharp">
public override void OnSave()
{
   this.Level = (int)VolumeSlider.Value;
}
</pre></p><p>Lastly, we need to set the title that shows up on the configuration window. To do this, override the <strong>Title</strong> property and have it return “Set Volume”:</p><p><pre class="brush: csharp">
public override string Title
{
   get { return &quot;Set Volume&quot;; }
}
</pre></p><p>Now we need to go back to the <strong>SetVolume</strong> class and implement those configuration related methods.</p><p>The <strong>ConfigurationControl</strong> property needs to return an instance of the <strong>SetVolumeConfig</strong> class. Remember that its constructor expects the current volume setting:</p><p><pre class="brush: csharp">
public WpfConfiguration ConfigurationControl
{
   get
   {
      return new SetVolumeConfig(level);
   }
}
</pre></p><p>Lastly, <strong>OnSaved</strong> takes the instance of <strong>WpfConfiguration</strong> control we just returned in the above property. We need to cast this back to <strong>SetVolumeConfig</strong> to be able to get access to the <strong>Level</strong> property:</p><p><pre class="brush: csharp">
public void OnSaved(WpfConfiguration configurationControl)
{
   var config = (SetVolumeConfig)configurationControl;
   this.level = config.Level;
}
</pre></p><p>That’s all it takes! This code provides us with a complete reaction that enables us to set the volume level on the computer. As you can see, we provide a very straightforward API enabling you, the developer, to write user configurable modules for Mayhem.&nbsp; You can click the <a href="http://media.ch9.ms/c4f/c4f/MayhemVolumeFinal.zip">download link at the top of the screen to get the final code in MayhemVolumeFinal.zip.</a></p><p>We have more documentation available on the available methods and APIs on our <a href="http://mayhem.codeplex.com/documentation">CodePlex documentation page</a>.</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/coding4fun/rss&WT.dl=0&WT.entryid=Entry:RSSView:faf9580cdc464e22a2d6a041014269f4">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/articles/Making-Mayhem-with-Volume-Control</comments>
      <link>http://channel9.msdn.com/coding4fun/articles/Making-Mayhem-with-Volume-Control</link>
      <itunes:summary>Why, hello there! We are going to pick up where we left off at the end of our Coding4Fun video. In the video we built a reaction that increments the volume level on the computer. We are going to expand from there to make a reaction that enables you to set the volume level to a specified volume.MayhemVolumeStart.zip file&amp;nbsp;contains the class library project all set up with the NuGet package references and the reaction that increments the volume.The first step we are going to take is to add the additional references we need to be configurable. The first reference is MayhemWpf from the same NuGet feed MayhemCore is from. (http://makemayhem.com/nuget). Add a reference to the following assemblies:PresentationCore PresentationFramework System.Runtime.Serialization System.Xaml WindowsBase. Next, we switch the code from incrementing the volume to setting the volume to 50%.To do this, replace the line:
device.AudioEndpointVolume.VolumeStepUp();
with
device.AudioEndpointVolume.MasterVolumeLevelScalar = 50 / 100.0f;
The reaction now works successfully to set the volume to half way. The next step is to make that setting configurable, and persist between application runs. Let’s make that 50 a variable. Add a private integer to the class (I’m calling it level) and change the above line to be:
device.AudioEndpointVolume.MasterVolumeLevelScalar = level / 100.0f;
Since that variable will be user configurable, we want to be able to show a string on the main window that says what the reaction is doing. To do this, we have to tell Mayhem that our reaction is configurable by implement the IWpfConfigurable interface from MayhemWpf.In order to set that configuration string we have to implement the method GetConfigString. The implementation of this method should return some string that provides a look into what the configuration settings are for the reaction.I will make the GetConfigString method be the following:
public string GetConfigString()
{
   return string.Format(&amp;quot;</itunes:summary>
      <pubDate>Mon, 30 Apr 2012 21:22:27 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/articles/Making-Mayhem-with-Volume-Control</guid>
      <dc:creator></dc:creator>
      <category>csharp</category>
      <category>wpf</category>
  </item>
  <item>
      <title>Project Detroit: OBD-II Manager</title>
      <description><![CDATA[<p>Read diagnostic information from your car and display it on a slick instrument cluster dashboard!</p><p>The <a href="http://obd.codeplex.com/"><strong>OBD-II Manager</strong></a> project is the OBD-II sub-system and instrument cluster application from the <a href="http://channel9.msdn.com/coding4fun/detroit">Project Detroit Mustang</a> 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><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.&nbsp;</p><p>This project contains a library you can use to integrate OBD data into your application, as well as a modified version of the actual Instrument Cluster application used in the Project Detroit car which shows how the library can be used.</p><p><strong>More Information</strong></p><ul><li><a href="http://channel9.msdn.com/coding4fun/articles/Project-Detroit-How-to-Read-Your-Cars-Engine-Data-with-OBD-II">Coding4Fun Article</a> </li><li><a href="http://channel9.msdn.com/coding4fun/detroit">Project Detroit</a> </li><li><a href="http://www.scantool.net/scan-tools/pc-based/obdlink-sx.html">OBD-II to USB cable</a> (ELM323/327-based OBD-II to USB cable) </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></ul><p><strong>Instrument Cluster Screenshots</strong></p><p><a href="http://files.channel9.msdn.com/thumbnail/b964d3a7-3494-4f60-9ffd-98e10f57cfdc.png" rel="lightbox"><img src="http://files.channel9.msdn.com/thumbnail/b964d3a7-3494-4f60-9ffd-98e10f57cfdc.png" alt=""></a></p><p><a href="http://files.channel9.msdn.com/thumbnail/ffbfa48f-e04b-400d-a79d-058641ed3642.png" rel="lightbox"><img src="http://files.channel9.msdn.com/thumbnail/ffbfa48f-e04b-400d-a79d-058641ed3642.png" alt=""></a></p><p><a href="http://files.channel9.msdn.com/thumbnail/a77f1db4-746d-4743-8e1b-9f0cc5618a84.png" rel="lightbox"><img src="http://files.channel9.msdn.com/thumbnail/a77f1db4-746d-4743-8e1b-9f0cc5618a84.png" alt=""></a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/coding4fun/rss&WT.dl=0&WT.entryid=Project:RSSView:4afca774455e450bbbd8a02e013f8ee0">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/projects/Project-Detroit-OBD-II-Manager</comments>
      <link>http://channel9.msdn.com/coding4fun/projects/Project-Detroit-OBD-II-Manager</link>
      <itunes:summary>Read diagnostic information from your car and display it on a slick instrument cluster dashboard!The OBD-II Manager project is the OBD-II sub-system and instrument cluster application from 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 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.&amp;nbsp;This project contains a library you can use to integrate OBD data into your application, as well as a modified version of the actual Instrument Cluster application used in the Project Detroit car which shows how the library can be used.More InformationCoding4Fun Article Project Detroit OBD-II to USB cable (ELM323/327-based OBD-II to USB cable) More information on OBD-II ELM323/327 Datasheet Instrument Cluster Screenshots</itunes:summary>
      <pubDate>Mon, 09 Apr 2012 19:23:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/projects/Project-Detroit-OBD-II-Manager</guid>
      <dc:creator>Brian Peek, Dan Fernandez</dc:creator>
      <category>coding4fun</category>
      <category>hardware</category>
      <category>project+detroit</category>
  </item>
  <item>
      <title>Boxing Bots: Kinect-Driven Pneumatic Boxing Robots</title>
      <description><![CDATA[<p><a title="Boxing Robots!" href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0296%5B5%5D.jpg" rel="lightbox"><img title="IMG_0296" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0296_thumb%5B2%5D.jpg" alt="IMG_0296" width="640" height="480" border="0"></a></p><p>At the SXSW Interactive Opening Party hosted by Frog Design and Microsoft, the Coding4Fun team has unveiled their latest invention, BoxingBots!</p><p>With BoxingBots you are the controller except this time, forget the screen. You’re controlling a 6-foot tall metal robot that’s trying to punch out your opponent’s 6-foot tall machine. It’s Real Steel in real time.</p><h3>Video Demo</h3><p>Watch Laura Foy's video of the <a href="http://channel9.msdn.com/posts/Boxing-Bots-at-South-by-South-West">BoxingBots in action</a>!</p><p>BoxingBots combines Kinect’s motion sensing technology with pneumatic robots in a 6-foot square ring. Two players face off to try to knock each other’s blocks off.</p><h3>Each robot has</h3><ul><li>1 On-board laptop PC </li><li>70 programmatic LEDs in the head and chest controlled by a Phidgets LED controller board </li><li>2 2.5 gallon tanks of compressed air @ 150 PSI </li><li>8 12-volt 17amp batteries </li><li>2 Roboteq motor controllers that power the four omni-directional wheels </li><li>2 5&quot; stroke cylinders that punches/retracts the arms </li><li>1 6' stroke cylinder that lifts the head when the robot is knocked out </li><li>2 button switches on the chest that are triggered by punches and a Phidget 8/8/8 interface board that controls the relays and buttons switches </li></ul><p>&nbsp;</p><h3>How gameplay happens</h3><ul><li>Each robot's on-board PC receive commands over the network from the Admin PC for movement, punches, score, etc </li><li>Each player stands in front of a Kinect for Windows-enabled PC that interprets their gestures (punch, move in a direction, strafe, rotate) and sends that as a command to the Admin PC </li><li>The Admin PC manages the game, including pausing, reset, starting, sending commands to the robots and receiving damage data from the robots when the robot has been punched </li></ul><p>&nbsp;</p><h3>Photos</h3><p>&nbsp;</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0290%5B5%5D.jpg"><img title="IMG_0290" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0290_thumb%5B2%5D.jpg" alt="IMG_0290" width="360" height="480"></a></p><p>&nbsp;</p><p>&nbsp;</p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0291%5B5%5D.jpg"><img title="IMG_0291" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0291_thumb%5B2%5D.jpg" alt="IMG_0291" width="640" height="480" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0292%5B5%5D.jpg"><img title="IMG_0292" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0292_thumb%5B2%5D.jpg" alt="IMG_0292" width="640" height="480" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0295%5B7%5D.jpg"><img title="IMG_0295" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0295_thumb%5B1%5D.jpg" alt="IMG_0295" width="640" height="480" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0298%5B3%5D.jpg"><img title="IMG_0298" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0298_thumb.jpg" alt="IMG_0298" width="640" height="480" border="0"></a></p><p><a href="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0300%5B3%5D.jpg"><img title="IMG_0300" src="http://files.channel9.msdn.com/wlwimages/ae054c0b4d7b402ab1239e6800c0220f/IMG_0300_thumb.jpg" alt="IMG_0300" width="640" height="480" border="0"></a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/coding4fun/rss&WT.dl=0&WT.entryid=Project:RSSView:d7eb062302294149a870a011001cbec0">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/projects/BoxingBots</comments>
      <link>http://channel9.msdn.com/coding4fun/projects/BoxingBots</link>
      <itunes:summary>At the SXSW Interactive Opening Party hosted by Frog Design and Microsoft, the Coding4Fun team has unveiled their latest invention, BoxingBots!With BoxingBots you are the controller except this time, forget the screen. You’re controlling a 6-foot tall metal robot that’s trying to punch out your opponent’s 6-foot tall machine. It’s Real Steel in real time.Video DemoWatch Laura Foy&#39;s video of the BoxingBots in action!BoxingBots combines Kinect’s motion sensing technology with pneumatic robots in a 6-foot square ring. Two players face off to try to knock each other’s blocks off.Each robot has1 On-board laptop PC 70 programmatic LEDs in the head and chest controlled by a Phidgets LED controller board 2 2.5 gallon tanks of compressed air @ 150 PSI 8 12-volt 17amp batteries 2 Roboteq motor controllers that power the four omni-directional wheels 2 5&amp;quot; stroke cylinders that punches/retracts the arms 1 6&#39; stroke cylinder that lifts the head when the robot is knocked out 2 button switches on the chest that are triggered by punches and a Phidget 8/8/8 interface board that controls the relays and buttons switches &amp;nbsp;How gameplay happensEach robot&#39;s on-board PC receive commands over the network from the Admin PC for movement, punches, score, etc Each player stands in front of a Kinect for Windows-enabled PC that interprets their gestures (punch, move in a direction, strafe, rotate) and sends that as a command to the Admin PC The Admin PC manages the game, including pausing, reset, starting, sending commands to the robots and receiving damage data from the robots when the robot has been punched &amp;nbsp;Photos&amp;nbsp;&amp;nbsp;&amp;nbsp;</itunes:summary>
      <pubDate>Sun, 11 Mar 2012 02:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/projects/BoxingBots</guid>
      <dc:creator>Brian Peek, Clint Rutkas, Rick Barraza</dc:creator>
  </item>
  <item>
      <title>Kinect Service</title>
      <description><![CDATA[<p>The <strong>Coding4Fun Kinect Service</strong> allows you to stream Kinect color, depth, skeleton, and audio from one PC to another PC or a Windows Phone via sockets. Both server and client libraries are available to send and receive the data.&nbsp; Please review the included WPF and Windows Phone samples for a quick explanation of how to use the libraries.&nbsp; Also check out the <a href="http://kinectservice.codeplex.com/documentation">Documentation tab</a> on CodePlex for more information and sample usage.</p><h2>WPF Sample Screenshots</h2><p><a href="http://download.codeplex.com/Download?ProjectName=kinectservice&amp;DownloadId=336814"><img title="Untitled" src="http://download.codeplex.com/Download?ProjectName=kinectservice&amp;DownloadId=336815" alt="Untitled" width="426" height="238" border="0"></a></p><h2>Windows Phone Sample Screenshots</h2><p><a href="http://download.codeplex.com/Download?ProjectName=kinectservice&amp;DownloadId=336926"><img title="3" src="http://download.codeplex.com/Download?ProjectName=kinectservice&amp;DownloadId=336927" alt="3" width="164" height="272" border="0"></a><a href="http://download.codeplex.com/Download?ProjectName=kinectservice&amp;DownloadId=336928"><img title="1" src="http://download.codeplex.com/Download?ProjectName=kinectservice&amp;DownloadId=336929" alt="1" width="164" height="272" border="0"></a><a href="http://download.codeplex.com/Download?ProjectName=kinectservice&amp;DownloadId=336930"><img title="2" src="http://download.codeplex.com/Download?ProjectName=kinectservice&amp;DownloadId=336931" alt="2" width="164" height="272" border="0"></a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/coding4fun/rss&WT.dl=0&WT.entryid=Project:RSSView:8c0d76e8ee8942c69f429feb0050b146">]]></description>
      <comments>http://channel9.msdn.com/coding4fun/projects/Kinect-Service</comments>
      <link>http://channel9.msdn.com/coding4fun/projects/Kinect-Service</link>
      <itunes:summary>The Coding4Fun Kinect Service allows you to stream Kinect color, depth, skeleton, and audio from one PC to another PC or a Windows Phone via sockets. Both server and client libraries are available to send and receive the data.&amp;nbsp; Please review the included WPF and Windows Phone samples for a quick explanation of how to use the libraries.&amp;nbsp; Also check out the Documentation tab on CodePlex for more information and sample usage.WPF Sample ScreenshotsWindows Phone Sample Screenshots</itunes:summary>
      <pubDate>Thu, 02 Feb 2012 04:53:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/coding4fun/projects/Kinect-Service</guid>
      <dc:creator>Brian Peek</dc:creator>
      <category>kinect</category>
  </item>    
</channel>
</rss>
