<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Hack a Day &#187; c++</title>
	<atom:link href="http://hackaday.com/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackaday.com</link>
	<description>Fresh hacks every day</description>
	<lastBuildDate>Fri, 10 Feb 2012 06:18:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='hackaday.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/5560f98f805877b0e332f191cb9e0af3?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Hack a Day &#187; c++</title>
		<link>http://hackaday.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://hackaday.com/osd.xml" title="Hack a Day" />
	<atom:link rel='hub' href='http://hackaday.com/?pushpress=hub'/>
		<item>
		<title>Trying to measure the speed of light with an Arduino</title>
		<link>http://hackaday.com/2011/12/01/trying-to-measure-the-speed-of-light-with-an-arduino/</link>
		<comments>http://hackaday.com/2011/12/01/trying-to-measure-the-speed-of-light-with-an-arduino/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 23:01:23 +0000</pubDate>
		<dc:creator>Brian Benchoff</dc:creator>
				<category><![CDATA[arduino hacks]]></category>
		<category><![CDATA[led hacks]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[speed of light]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=62436</guid>
		<description><![CDATA[We know that measuring the speed of light with an Arduino is possible. It&#8217;s just that the implementation is hard. Last month we saw [Udo]&#8216;s blinkenlight shield that can be used as a line scan camera. It&#8217;s a neat piece of kit, but [Udo] really wants to submit something for the Buildlounge laser cutter giveaway, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=62436&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-large wp-image-62442" title="laser" src="http://hackadaycom.files.wordpress.com/2011/12/laser.jpg?w=450&#038;h=319" alt="" width="450" height="319" /></p>
<p>We know that measuring the speed of light with an Arduino is possible. It&#8217;s just that <a href="http://blog.blinkenlight.net/2011/12/01/thank-you-world/">the implementation is hard</a>.</p>
<p>Last month we saw [Udo]&#8216;s <a href="http://hackaday.com/2011/11/01/turning-leds-into-a-camera/">blinkenlight shield</a> that can be used as a line scan camera. It&#8217;s a neat piece of kit, but [Udo] really wants to submit something for the <a href="http://www.buildlounge.com/2011/10/07/buildlounge-and-full-spectrum-lasers-are-giving-away-a-laser-cutter/">Buildlounge laser cutter giveaway</a>, so he figured measuring the speed of light would be an easy project. If a <a href="http://www.youtube.com/watch?feature=player_embedded&amp;v=9O2Keu6o3i0#!">kid and a chocolate bar</a> can do it, surely it can&#8217;t be too hard.</p>
<p>[Udo] hit upon the idea of pulsing a laser pointer and measuring the time of the reflection. Because his blinkenlight shield can be used as a light sensor, all that&#8217;s needed is a mirror and a pretty long line of sight. There&#8217;s a few problems with the setup though: with the Arduino running at 16 MHz, a photon will travel 19 meters in one clock cycle.</p>
<p>Even with some very clever coding, we&#8217;re not really sure detecting an emitted photon is possible at such (relatively) slow clock speeds. We&#8217;re thinking [Udo] could source a few hundred meters of optic fiber so the entire experiment could fit on a desk, but feel free to drop a note in the comments if you&#8217;ve got a better idea. [Udo]&#8216;s demo of his blinkenlight/laser mashup is after the break.</p>
<p><span id="more-62436"></span></p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2011/12/01/trying-to-measure-the-speed-of-light-with-an-arduino/"><img src="http://img.youtube.com/vi/YrYRM3ApAoE/2.jpg" alt="" /></a></span>
<br />Filed under: <a href='http://hackaday.com/category/arduino-hacks/'>arduino hacks</a>, <a href='http://hackaday.com/category/led-hacks/'>led hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/62436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/62436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/62436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/62436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/62436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/62436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/62436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/62436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/62436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/62436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/62436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/62436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/62436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/62436/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=62436&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/12/01/trying-to-measure-the-speed-of-light-with-an-arduino/feed/</wfw:commentRss>
		<slash:comments>63</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">brianbenchoff</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/12/laser.jpg?w=450" medium="image">
			<media:title type="html">laser</media:title>
		</media:content>
	</item>
		<item>
		<title>C bit field structures for microcontroller multitasking</title>
		<link>http://hackaday.com/2011/11/22/c-bit-field-structures-for-microcontroller-multitasking/</link>
		<comments>http://hackaday.com/2011/11/22/c-bit-field-structures-for-microcontroller-multitasking/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 16:01:23 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[bit field]]></category>
		<category><![CDATA[C language]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[multitasking]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=61740</guid>
		<description><![CDATA[So you&#8217;re getting better at programming microcontrollers and now you want to do several things at once? You know better than that, microcontrollers are only capable of processing one thing at a time. But if you&#8217;re clever with your coding you can achieve something that behaves as if several things are going on at once. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=61740&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-61747" title="bit-field-tutorial" src="http://hackadaycom.files.wordpress.com/2011/11/bit-field-tutorial.jpg" alt="" width="470" height="263" /></p>
<p>So you&#8217;re getting better at programming microcontrollers and now you want to do several things at once? You know better than that, microcontrollers are only capable of processing one thing at a time. But if you&#8217;re clever with your coding you can achieve something that behaves as if several things are going on at once. The most common way to do this is to set a flag using an interrupt, then use the main loop to check for that flag. [S1axter] posted a tutorial on this topic where <a href="http://www.mybitbox.com/2011/11/video-blog-time-and-bitfield-structs-in-micros/">he uses bit field structures to help simplify</a> time sensitive events.</p>
<p>We think [S1axter] did a fantastic job of explaining this moderately difficult topic clearly and quickly. In the video after the break he begins by explaining <a href="http://en.wikipedia.org/wiki/C_syntax#Bit_fields">what a bit field is</a> and how it is defined. Basically you&#8217;re using a C structure to track a flag using just one bit of storage. This way the flag is either set or not. We suggest you pay careful attention to how he declares the structures as volatile, so you don&#8217;t have unexpected behavior when you try it yourself.</p>
<p><span id="more-61740"></span><span style="text-align:center; display: block;"><a href="http://hackaday.com/2011/11/22/c-bit-field-structures-for-microcontroller-multitasking/"><img src="http://img.youtube.com/vi/Voqg4Mx2Sg8/2.jpg" alt="" /></a></span></p>
<br />Filed under: <a href='http://hackaday.com/category/microcontrollers/'>Microcontrollers</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/61740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/61740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/61740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/61740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/61740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/61740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/61740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/61740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/61740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/61740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/61740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/61740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/61740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/61740/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=61740&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/11/22/c-bit-field-structures-for-microcontroller-multitasking/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/11/bit-field-tutorial.jpg" medium="image">
			<media:title type="html">bit-field-tutorial</media:title>
		</media:content>
	</item>
		<item>
		<title>On the life of [Dennis Ritchie]</title>
		<link>http://hackaday.com/2011/10/17/on-the-life-of-dennis-ritchie/</link>
		<comments>http://hackaday.com/2011/10/17/on-the-life-of-dennis-ritchie/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 23:01:59 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[dennis ritchie]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=58815</guid>
		<description><![CDATA[Chances are you have already heard of the passing of [Dennis Ritchie]. We admit, we&#8217;re among the throngs who knew little of his life, but [Cade Metz] has posted an excellent remembrance of his life which we think is well worth reading. [Dennis] passed on October 12th at the age of 70. This image shows him receiving [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=58815&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-58816" title="dennis-ritchie" src="http://hackadaycom.files.wordpress.com/2011/10/dennis-ritchie.jpg" alt="" width="470" height="400" /></p>
<p>Chances are you have already heard of the passing of [Dennis Ritchie]. We admit, we&#8217;re among the throngs who knew little of his life, but [Cade Metz] has posted <a href="http://www.wired.com/wiredenterprise/2011/10/thedennisritchieeffect/">an excellent remembrance of his life</a> which we think is well worth reading.</p>
<p>[Dennis] passed on October 12th at the age of 70. This image shows him receiving the National Medal of Technology awarded to him by [Bill Clinton] in 1998. His legacy lives on in the work that earned him this award as the creator of the C programming language; a side project which he developed to help him achieve the creation of a new system kernel called UNIX. This work, of course, was the precursor that led to universal software packages like OSX, iOS, Linux, and even Windows (which at one point was itself written using the C language).</p>
<p>There has been some Internet fodder regarding media coverage of [Steve Jobs'] death and not of [Dennis'] passing. It&#8217;s harder for those lacking experience with programming to comprehend [Dennis'] contributions. We&#8217;re glad to have an opportunity to pass on the story of his life and to take a moment to appreciate his accomplishments.</p>
<p>[Thanks Dave]</p>
<p>[<a href="http://commons.wikimedia.org/wiki/File:Dennis_MacAlistair_Ritchie_.jpg">Photo Source</a>]</p>
<br />Filed under: <a href='http://hackaday.com/category/news/'>news</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/58815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/58815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/58815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/58815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/58815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/58815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/58815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/58815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/58815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/58815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/58815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/58815/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/58815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/58815/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=58815&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/10/17/on-the-life-of-dennis-ritchie/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/10/dennis-ritchie.jpg" medium="image">
			<media:title type="html">dennis-ritchie</media:title>
		</media:content>
	</item>
		<item>
		<title>BASIC programming on an Arduino</title>
		<link>http://hackaday.com/2011/08/28/basic-programming-on-an-arduino/</link>
		<comments>http://hackaday.com/2011/08/28/basic-programming-on-an-arduino/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 22:05:44 +0000</pubDate>
		<dc:creator>Brian Benchoff</dc:creator>
				<category><![CDATA[arduino hacks]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[basic interpreter]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[tiny BASIC]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=54008</guid>
		<description><![CDATA[[Mike] sent in a project he&#8217;s been working on &#8211; a port of a BASIC interpreter that fits on an Arduino. The code is meant to be a faithful port of Tiny BASIC for the 68000, and true to Tiny BASIC form, it fits in the very limited RAM of the Arduino. True to Tiny [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=54008&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-large wp-image-54010" title="Basic" src="http://hackadaycom.files.wordpress.com/2011/08/basic.png?w=450&#038;h=238" alt="" width="450" height="238" /></p>
<p>[Mike] sent in a project he&#8217;s been working on &#8211; a <a href="http://ec2-122-248-210-243.ap-southeast-1.compute.amazonaws.com/mediawiki/index.php/Arduino_Basic">port of a BASIC interpreter</a> that fits on an Arduino. The code is meant to be a faithful port of <a href="http://members.shaw.ca/gbrandly/68ktinyb.html">Tiny BASIC for the 68000</a>, and true to Tiny BASIC form, it fits in the very limited RAM of the Arduino.</p>
<p>True to Tiny BASIC&#8217;s assembler roots, [Mike]&#8216;s C port makes extensive use of the &#8220;infinitely-abusable&#8221; goto statement. <a href="http://books.google.com/books/about/The_C_Programming_Language.html?id=161QAAAAMAAJ">Kernighan and Ritchie</a> said themselves, &#8220;code involving a goto can alway be written without one&#8221; but [Mike] found that using goto left a lot more room available for BASIC code. The BASIC interpreter eats up around 600 bytes in the Arduino RAM, leaving about 1.4 kB for BASIC code. Not much, but more than the lowest-end <a href="http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/ProductID/3/List/1/Default.aspx?SortField=UnitCost,ProductName">BASIC Stamp</a>.</p>
<p>[Mike] says he started this project to see how &#8216;old bearded ones&#8217; conjured up so many impressive programs with a few kB of RAM. Tiny BASIC was originally conceived for the <a href="http://oldcomputers.net/altair.html">Altair 8800</a> that shipped with 256 <em>bytes</em> of RAM stock, so it seemed like a perfect fit. Right now, all we know is we&#8217;ll be spending the weekend digging through our copies of <em>Dr. Dobb&#8217;s Journal</em>.</p>
<br />Filed under: <a href='http://hackaday.com/category/arduino-hacks/'>arduino hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/54008/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/54008/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/54008/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/54008/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/54008/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/54008/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/54008/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/54008/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/54008/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/54008/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/54008/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/54008/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/54008/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/54008/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=54008&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/08/28/basic-programming-on-an-arduino/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">brianbenchoff</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/08/basic.png?w=450" medium="image">
			<media:title type="html">Basic</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft&#8217;s attempt at an Arduino killer &#8212; feels like a gimmick</title>
		<link>http://hackaday.com/2011/08/03/microsofts-attempt-at-an-arduino-killer-feels-like-a-gimmick/</link>
		<comments>http://hackaday.com/2011/08/03/microsofts-attempt-at-an-arduino-killer-feels-like-a-gimmick/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 18:24:38 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[gadgeteer]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=51181</guid>
		<description><![CDATA[Microsoft has thrown its hat into the open source hardware hobby market. Their offering is called the Gadgeteer. We&#8217;d love to tell you all about it, but the big M didn&#8217;t make it very easy to find out about the device and it&#8217;s addons. When we set out to find what processor is running on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=51181&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-51182" title="microsoft-arduino-killer" src="http://hackadaycom.files.wordpress.com/2011/08/microsoft-arduino-killer-e1312384011177.png" alt="" width="470" height="348" /></p>
<p>Microsoft has thrown its hat into the open source hardware hobby market. Their offering is called <a href="http://netmf.com/gadgeteer/">the Gadgeteer</a>. We&#8217;d love to tell you all about it, but the big M didn&#8217;t make it very easy to find out about the device and it&#8217;s addons. When we set out to find what processor is running on the board we were happy to see that they do call it an Open Source Hardware project, but no schematic is posted. When we did finally navigate to the hardware documentation it&#8217;s a file that must be downloaded and you&#8217;ve got to agree to their licensing before grabbing it. So that&#8217;s as far as we went, and now we&#8217;ll go back to using more open tools.</p>
<p>For those of you who aren&#8217;t scared off by the lack of openness, the first thing you&#8217;ll notice about this board is that it&#8217;s full of connector headers. Instead of the small rows that Arduino uses, the Gadgeteer is meant to use ribbon cables to connect to various breakout boards. You can program for the platform in C# using the .NET framework. This means using Microsoft Visual Studio for those that are already acquainted with the platform. But regular readers will note that we&#8217;re always looking for Linux support in our IDEs and you won&#8217;t find that here.</p>
<p>[Thanks Hrasdt (and several others) via <a href="http://hardware.slashdot.org/story/11/08/03/0012203/NET-Gadgeteer-mdash-Microsofts-Arduino-Killer">Slashdot</a>]</p>
<br />Filed under: <a href='http://hackaday.com/category/microcontrollers/'>Microcontrollers</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/51181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/51181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/51181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/51181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/51181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/51181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/51181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/51181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/51181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/51181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/51181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/51181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/51181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/51181/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=51181&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/08/03/microsofts-attempt-at-an-arduino-killer-feels-like-a-gimmick/feed/</wfw:commentRss>
		<slash:comments>118</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/08/microsoft-arduino-killer-e1312384011177.png" medium="image">
			<media:title type="html">microsoft-arduino-killer</media:title>
		</media:content>
	</item>
		<item>
		<title>Over-engineered clock finds purpose as RSS reader</title>
		<link>http://hackaday.com/2011/02/21/over-engineered-clock-finds-purpose-as-rss-reader/</link>
		<comments>http://hackaday.com/2011/02/21/over-engineered-clock-finds-purpose-as-rss-reader/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 22:01:51 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[clock hacks]]></category>
		<category><![CDATA[18f4550]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=35567</guid>
		<description><![CDATA[[Bob Alexander] admits that he over-engineered his clock, giving it eight control buttons, eight twelve-segment alpha-numeric display digits, a GPS module as a time source, and a beefy microcontroller to boot. But he&#8217;s found a way to get more for his money out of the device by adding RSS and weather features to it. Since [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=35567&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-35568" title="clock-and-rss-feed" src="http://hackadaycom.files.wordpress.com/2011/02/clock-and-rss-feed.jpg" alt="" width="470" height="334" /></p>
<p>[Bob Alexander] admits that he over-engineered his clock, giving it eight control buttons, eight twelve-segment alpha-numeric display digits, a GPS module as a time source, and a beefy microcontroller to boot. But he&#8217;s found a way to get more for his money out of the device by <a href="http://galacticstudios.org/component/content/article/2-electronics/25-leddisplay">adding RSS and weather features to it</a>.</p>
<p>Since he&#8217;s using the PIC 18F4550 it&#8217;s a snap to add USB connectivity. From there he wrote a fantastic PC-side application for communicating with the display. Now he has the option of displaying time, RSS feeds, or weather by scrolling through the options with one of the buttons. Perhaps the best feature is the option to launch a browser on the PC and view the current story just by pressing a button on the display. Check out the two demos after the break; one shows the clock features and the other demonstrates the C# software.</p>
<p><span id="more-35567"></span></p>
<p>Clock  features</p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2011/02/21/over-engineered-clock-finds-purpose-as-rss-reader/"><img src="http://img.youtube.com/vi/Uf6kbmxlLlU/2.jpg" alt="" /></a></span>
<p>Software features</p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2011/02/21/over-engineered-clock-finds-purpose-as-rss-reader/"><img src="http://img.youtube.com/vi/PrWVMo_Bmfs/2.jpg" alt="" /></a></span>
<br />Filed under: <a href='http://hackaday.com/category/clock-hacks/'>clock hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/35567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/35567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/35567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/35567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/35567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/35567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/35567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/35567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/35567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/35567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/35567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/35567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/35567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/35567/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=35567&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2011/02/21/over-engineered-clock-finds-purpose-as-rss-reader/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2011/02/clock-and-rss-feed.jpg" medium="image">
			<media:title type="html">clock-and-rss-feed</media:title>
		</media:content>
	</item>
		<item>
		<title>Kindle terminal with secret key-press activation</title>
		<link>http://hackaday.com/2010/12/10/kindle-terminal-with-secret-key-press-activation/</link>
		<comments>http://hackaday.com/2010/12/10/kindle-terminal-with-secret-key-press-activation/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 21:00:50 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[handhelds hacks]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[kindle]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=31583</guid>
		<description><![CDATA[[Luigi Rizzo] has been working on some hacks for his 3rd generation Kindle. There is already a Python based terminal emulator called AjaxTerm but he wanted a lightweight standalone so he reimplemented the program in C. The 100k binary monitors the keyboard, launching the terminal emulator when it detects a Shift-T sequence. It also uses [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=31583&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-31584" title="kindle-3-terminal" src="http://hackadaycom.files.wordpress.com/2010/12/kindle-3-terminal.jpg" alt="" width="470" height="353" /></p>
<p>[Luigi Rizzo] has been working on some hacks for his 3rd generation Kindle. There is already a Python based terminal emulator called AjaxTerm but he wanted a lightweight standalone so <a href="http://info.iet.unipi.it/~luigi/kindle/">he reimplemented the program in C</a>. The 100k binary monitors the keyboard, launching the terminal emulator when it detects a Shift-T sequence. It also uses alternative key mapping to fill in for some of the keys the Kindle&#8217;s keyboard is missing.</p>
<p>We haven&#8217;t seen a whole lot of Kindle hacking since it was <a href="http://hackaday.com/2009/09/03/ubuntu-9-04-on-kindle-2/">hacked to run Ubuntu</a>. Seems like this terminal emulator is a useful and unobtrusive hack to try out on the beloved reader.</p>
<br />Filed under: <a href='http://hackaday.com/category/handhelds-hacks/'>handhelds hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/31583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/31583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/31583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/31583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/31583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/31583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/31583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/31583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/31583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/31583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/31583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/31583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/31583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/31583/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=31583&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/12/10/kindle-terminal-with-secret-key-press-activation/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/12/kindle-3-terminal.jpg" medium="image">
			<media:title type="html">kindle-3-terminal</media:title>
		</media:content>
	</item>
		<item>
		<title>Rendering a 3D environment from Kinect video</title>
		<link>http://hackaday.com/2010/11/15/rendering-a-3d-environment-from-kinect-video/</link>
		<comments>http://hackaday.com/2010/11/15/rendering-a-3d-environment-from-kinect-video/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 19:00:08 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[Kinect hacks]]></category>
		<category><![CDATA[video hacks]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[Kinect]]></category>
		<category><![CDATA[render]]></category>
		<category><![CDATA[scanning]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=30754</guid>
		<description><![CDATA[[Oliver Kreylos] is using an Xbox Kinect to render 3D environments from real-time video. In other words, he takes the video feed from the Kinect and runs it through some C++ software he wrote to index the pixels in a 3D space that can be manipulated as it plays back. The image above is the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=30754&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-30755" title="kinect-3D-rendering" src="http://hackadaycom.files.wordpress.com/2010/11/kinect-3d-rendering.jpg" alt="" width="470" height="316" /></p>
<p>[Oliver Kreylos] is using an <a href="http://idav.ucdavis.edu/~okreylos/ResDev/Kinect/index.html">Xbox Kinect to render 3D environments from real-time video</a>. In other words, he takes the video feed from the Kinect and runs it through some C++ software he wrote to index the pixels in a 3D space that can be manipulated as it plays back. The image above is the result of the Kinect recording video by looking at [Oliver] from his right side. He&#8217;s moved the viewer&#8217;s playback perspective to be above and in front of him. Part of his body is missing and there is a black shadow because the camera cannot see these areas from its perspective. This is very similar to the <a href="http://hackaday.com/2009/12/30/update-realtime-3d-for-you-too/">real-time 3D scanning</a> we&#8217;ve seen in the past, but the hardware and software combination make this a snap to reproduce. Get the source code from his page linked at the top and don&#8217;t miss his demo video after the break.</p>
<p><span id="more-30754"></span></p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2010/11/15/rendering-a-3d-environment-from-kinect-video/"><img src="http://img.youtube.com/vi/7QrnwoO1-8A/2.jpg" alt="" /></a></span>
<p>[Thanks Peter]</p>
<br />Filed under: <a href='http://hackaday.com/category/kinect-hacks/'>Kinect hacks</a>, <a href='http://hackaday.com/category/video-hacks/'>video hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/30754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/30754/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/30754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/30754/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/30754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/30754/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/30754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/30754/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/30754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/30754/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/30754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/30754/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/30754/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/30754/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=30754&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/11/15/rendering-a-3d-environment-from-kinect-video/feed/</wfw:commentRss>
		<slash:comments>76</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/11/kinect-3d-rendering.jpg" medium="image">
			<media:title type="html">kinect-3D-rendering</media:title>
		</media:content>
	</item>
		<item>
		<title>C# Portable Settings Provider</title>
		<link>http://hackaday.com/2010/11/15/c-portable-settings-provider/</link>
		<comments>http://hackaday.com/2010/11/15/c-portable-settings-provider/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 14:47:58 +0000</pubDate>
		<dc:creator>Greg R. Jacobs</dc:creator>
				<category><![CDATA[software hacks]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[portable]]></category>
		<category><![CDATA[provider]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=30742</guid>
		<description><![CDATA[We live in a world where everything must be portable, ranging from mobile applications to making an application able to run on Linux, Windows and OS X.  Making a C# application to be completely portable across all windows computers is a problem that Microsoft knows about and willingly admits they will not fix. [Mike] from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=30742&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter" src="https://lh6.googleusercontent.com/HDho6CKOelkdDSNmxrXLDAR_kpMJB5KYTKp8ketKo4mhtiOvFi9hAm8Ss_jj-XkzMpaY_TirKYGDIaXz-6LKhBEAtZu5A6fcDJLJSxRYtMZfRTiHmw" alt="" width="419px;" height="67px;" /></p>
<p>We live in a world where everything must be portable, ranging from mobile applications to making an application able to run on Linux, Windows and OS X.  Making a C# application to be completely portable across all windows computers is a problem that Microsoft knows about and willingly admits they will not fix. [Mike] from Geek Republic has taken it upon himself to show us how to <a href="http://www.geek-republic.com/2010/11/08/c-portable-settings-provider/">hack up some code to make your programs portable</a>.  This code is a good push forward for people loving the portability of modern applications. He will admit that bugs may exist so be on the lookout and he would probably appreciate the feedback.  Looking forward to a fully working provider so that .NET applications can be carried wherever people go!</p>
<br />Filed under: <a href='http://hackaday.com/category/software-hacks/'>software hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/30742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/30742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/30742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/30742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/30742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/30742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/30742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/30742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/30742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/30742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/30742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/30742/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/30742/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/30742/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=30742&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/11/15/c-portable-settings-provider/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		<georss:point>43.002684 -81.214990</georss:point>
		<geo:lat>43.002684</geo:lat>
		<geo:long>-81.214990</geo:long>
		<media:content url="" medium="image">
			<media:title type="html">greggers120588</media:title>
		</media:content>

		<media:content url="https://lh6.googleusercontent.com/HDho6CKOelkdDSNmxrXLDAR_kpMJB5KYTKp8ketKo4mhtiOvFi9hAm8Ss_jj-XkzMpaY_TirKYGDIaXz-6LKhBEAtZu5A6fcDJLJSxRYtMZfRTiHmw" medium="image" />
	</item>
		<item>
		<title>Under-desk RGB keyboard lighting</title>
		<link>http://hackaday.com/2010/11/11/under-desk-rgb-keyboard-lighting/</link>
		<comments>http://hackaday.com/2010/11/11/under-desk-rgb-keyboard-lighting/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 21:00:35 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[home hacks]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[desk]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[rgb]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=30587</guid>
		<description><![CDATA[[Jay Collett] was having trouble seeing his keyboard when the room was dim. But throwing a light under the desk just didn&#8217;t seem cool enough. Instead he built an RGB light board that is controlled by his desktop. The board is based around an ATmega328 with the Arduino booloader. He etched a single-sided PCB to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=30587&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-30591" title="under-desk-keyboard-light" src="http://hackadaycom.files.wordpress.com/2010/11/under-desk-keyboard-light1-e1289495811248.jpg" alt="" width="470" height="353" /></p>
<p>[Jay Collett] was having trouble seeing his keyboard when the room was dim. But throwing a light under the desk just didn&#8217;t seem cool enough. Instead he built <a href="http://www.jaycollett.com/2010/11/arduino-clone-powered-rgb-keyboard-light/">an RGB light board that is controlled by his desktop</a>. The board is based around an ATmega328 with the Arduino booloader. He etched a single-sided PCB to connect it to a group of five RGB LEDs, with a programming header for an FTDI cable. The board communicates with a PC via serial connection, with a C# control application that [Jay] coded to control the color. We&#8217;ve embedded a couple of videos after the break but check his page for a package of code and hi-res pictures.</p>
<p>If you want something cool that&#8217;s a little bit less work to build check out the EL-wire keyboard <a href="http://hackaday.com/2010/08/22/hackaday-links-august-22-2010/">from this links post</a>.</p>
<p><span id="more-30587"></span></p>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2010/11/11/under-desk-rgb-keyboard-lighting/"><img src="http://img.youtube.com/vi/dtvuBaSUJco/2.jpg" alt="" /></a></span>
<span style="text-align:center; display: block;"><a href="http://hackaday.com/2010/11/11/under-desk-rgb-keyboard-lighting/"><img src="http://img.youtube.com/vi/H2rnBi3CSaE/2.jpg" alt="" /></a></span>
<br />Filed under: <a href='http://hackaday.com/category/home-hacks/'>home hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/30587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/30587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/30587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/30587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/30587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/30587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/30587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/30587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/30587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/30587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/30587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/30587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/30587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/30587/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=30587&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/11/11/under-desk-rgb-keyboard-lighting/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/11/under-desk-keyboard-light1-e1289495811248.jpg" medium="image">
			<media:title type="html">under-desk-keyboard-light</media:title>
		</media:content>
	</item>
		<item>
		<title>AVR Programming 03: Reading and compiling code</title>
		<link>http://hackaday.com/2010/11/05/avr-programming-03-reading-and-compiling-code/</link>
		<comments>http://hackaday.com/2010/11/05/avr-programming-03-reading-and-compiling-code/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 22:00:09 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[how-to]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[bitwise]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[datasheet]]></category>
		<category><![CDATA[programmer]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=29460</guid>
		<description><![CDATA[In the last installment of our tutorial series we built a simple circuit on a breadboard and programmed an ATmega168 to make it run. That proves that you know how to follow directions, but the eureka moments of doing everything yourself are on the way. This time around you will get down and dirty with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=29460&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-29579" title="avr-programming-for-everyone" src="http://hackadaycom.files.wordpress.com/2010/10/avr-programming-for-everyone.jpg" alt="" width="470" height="150" /></p>
<p>In <a href="http://hackaday.com/2010/10/25/avr-programming-02-the-hardware/">the last installment</a> of our tutorial series we built a simple circuit on a breadboard and programmed an ATmega168 to make it run. That proves that you know how to follow directions, but the eureka moments of doing everything yourself are on the way. This time around you will get down and dirty with the datasheet, learning where each line of the sample code came from, and give your recently installed compiler a test drive. We will:</p>
<ul>
<li>Talk about bitwise operators and how they work when coding for microcontrollers</li>
<li>Discuss C code shorthand</li>
<li>Review the sample code from Part 2 and talk about what each line of code does</li>
<li>Learn to compile code</li>
</ul>
<p>If this is the first you&#8217;ve heard about our AVR Programming series, head back to <a href="http://hackaday.com/2010/10/23/avr-programming-introduction/">Part 1</a> and start from the beginning. Otherwise, take a deep breath and we&#8217;ll being after the break.</p>
<p><strong>Series roadmap:</strong></p>
<ul>
<li><a title="Permanent Link to AVR Programming 01: Introduction" rel="bookmark" href="http://hackaday.com/2010/10/23/avr-programming-introduction/">AVR Programming 01: Introduction</a></li>
<li><a title="Permanent Link to AVR Programming 01: Introduction" rel="bookmark" href="http://hackaday.com/2010/10/23/avr-programming-introduction/"></a><a title="Permanent Link to AVR Programming 02: The Hardware" rel="bookmark" href="http://hackaday.com/2010/10/25/avr-programming-02-the-hardware/">AVR Programming 02: The Hardware</a></li>
<li><a title="Permanent Link to AVR Programming 02: The Hardware" rel="bookmark" href="http://hackaday.com/2010/10/25/avr-programming-02-the-hardware/"></a><a title="Permanent Link to AVR Programming 03: Reading and compiling code" rel="bookmark" href="http://hackaday.com/2010/11/05/avr-programming-03-reading-and-compiling-code/">AVR Programming 03: Reading and compiling code</a></li>
<li><a href="http://hackaday.com/2010/11/19/avr-programming-04-writing-code-etc/">AVR Programming 04: Writing code</a></li>
</ul>
<p><span id="more-29460"></span></p>
<h2>Prerequisites</h2>
<ul>
<li>You must know something about C code. The ability to read it is probably good enough, Google can help you with the rest as you learn.</li>
<li>It helps if you have a text editor that includes syntax highlighting. I&#8217;m purely a Linux user and I like to use both Kate and Gedit depending on my mood. But I also use nano from the shell quite frequently. This is a tool and your choice is purely personal preference.</li>
<li>Grab <a href="https://github.com/szczys/had_AVRtut_2/archives/master">the sample code from part 2</a> of the series. I&#8217;ve embedded it below but you may want it in a separate windows for reference.</li>
<li>Datasheets; the instruction manual for hardware. Grab <a href="http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf">the datasheet for the ATmega168</a> as I&#8217;ll be referencing specific pages as examples. Knowing how to look up information in the datasheet and turn it into code will make it easy for you to use any chip in the AVR family.</li>
</ul>
<h2>Bitwise Operators</h2>
<p>Even though we&#8217;ll be writing code in the C language, we&#8217;re quite close to the hardware when programming microcontrollers. Because of this <strong>you must understand bitwise operators</strong>. Not just kind of, not intuitively, you should know them well enough to teach them to someone else without looking it up.</p>
<p>Hands down the best explanation I&#8217;ve ever come across is by [Eric Weddington], who also co-authored the makefile that came with my example code. It is also known as <a href="http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;file=viewtopic&amp;t=37871">Programming 101.</a> Read it, know it, love it. But I&#8217;ll try to give a quick crash course for those to lazy to read his whole lesson.</p>
<div style="padding-left:30px;">
<table border="1">
<tbody>
<tr>
<th>Code Symbol</th>
<th>Logic Function</th>
</tr>
<tr>
<td align="center">|</td>
<td align="center">OR</td>
</tr>
<tr>
<td align="center">&amp;</td>
<td align="center">AND</td>
</tr>
<tr>
<td align="center">~</td>
<td align="center">NOT</td>
</tr>
<tr>
<td align="center">^</td>
<td align="center">XOR</td>
</tr>
<tr>
<td align="center">&lt;&lt;</td>
<td align="center">Shift Left</td>
</tr>
<tr>
<td align="center">&gt;&gt;</td>
<td align="center">Shift Right</td>
</tr>
</tbody>
</table>
</div>
<p>The list above shows all of the code symbols and their logic operation.</p>
<ul>
<li>OR &#8211; true if either or both bits being compared are 1</li>
<li>AND &#8211; true only if both bits being compared are 1</li>
<li>NOT &#8211; results in the opposite of a value (~1 = 0, ~0 = 1)</li>
<li>XOR &#8211; exclusive OR&#8230; true if one bit being compared is 1 but false if neither or both of them are</li>
<li>Shift Left &#8211; moves bits left within a binary number. (1&lt;&lt;0 = 0b0001, 1&lt;&lt;4 = 0b1000)</li>
<li>Shift Right &#8211; moves bits to the right a desired amount (0b1000&gt;&gt;2 = 0b0010)</li>
</ul>
<p>We&#8217;re going to use Shift Left all the time in our code because it&#8217;s a quick way to build a binary number. We&#8217;re <strong>always</strong> working in binary numbers made up of eight bits. Those bits are numbered 0-7 because counting always starts with 0 when it comes to microcontrollers. So if you want to set the fifth bit to a logic high (&#8217;1&#8242;) you would shift &#8217;1&#8242; left by 5:</p>
<pre>1&lt;&lt;5</pre>
<p>This will result in the binary number 0b00100000. If this is child&#8217;s play, move to the next section. If not, read [Eric's] tutorial.</p>
<h2>C Code Shorthand</h2>
<p>I tend to use shorthand in my code as my hands often hurt from too much typing (as they do now). This saves a bit on the old ibuprofen expenditure for the month by allowing me to type less characters to accomplish the same simple assignments. Here&#8217;s a quick table of examples:</p>
<div style="padding-left:30px;">
<table border="1">
<tbody>
<tr>
<th>Traditional Code</th>
<th>Shorthand Equivalent</th>
</tr>
<tr>
<td align="center">value = value + 1;</td>
<td align="center">value += 1;</td>
</tr>
<tr>
<td align="center">value = value &gt;&gt; 1;</td>
<td align="center">value &gt;&gt;= 1;</td>
</tr>
<tr>
<td align="center">value = value &amp; bitMask;</td>
<td align="center">value &amp;= bitMask;</td>
</tr>
<tr>
<td align="center">value = value | bitMask;</td>
<td align="center">value |= bitMask;</td>
</tr>
<tr>
<td align="center">PORTD = PORTD ^ (1&lt;&lt;0);</td>
<td align="center">PORTD ^= (1&lt;&lt;0);</td>
</tr>
</tbody>
</table>
</div>
<p>So basically, if I am setting a variable by using that same variable as the first <a href="http://en.wikipedia.org/wiki/Operand">operand</a> I can just place the <a href="http://en.wikipedia.org/wiki/Operator">operator</a> before the equals sign and put the second operand after the equals sign to accomplish the same task without typing the variable name twice. If you understood that sentence you&#8217;re doing quite well!</p>
<p><span style="font-size:20px;font-weight:bold;">Jump into the sample code</span></p>
<p><strong>Psuedocode</strong></p>
<p>A good practice when developing code is to write psuedocode. Something that clearly states what you want to do in plain language. This is an outline of the structure that your program will take and it shouldn&#8217;t include any specific code, but will be replaced by that code later:</p>
<p><pre class="brush: cpp;">//Setup the clock
  //prepare an interrupt every 1 second

//Setup the I/O for the LED

//toggle the LED during each interrupt</pre></p>
<p>This program is so simple that the psuedocode seems unnecessary, but it will keep you focused and help stave off errors on larger projects.</p>
<p><strong>The Actual Code</strong></p>
<p>The main.c from the <a href="https://github.com/szczys/had_AVRtut_2/archives/master">Part 2 sample code</a> is embedded below. Take a minute to match up the parts of the psuedocode above with actual code blocks below.</p>
<p><pre class="brush: cpp; wrap-lines: false;">/*
* Hackaday.com AVR Tutorial firmware
* written by: Mike Szczys (@szczys)
* 10/24/2010
*
* ATmega168
* Blinks one LED conneced to PD0
*
* http://hackaday.com/2010/10/25/avr-programming-02-the-hardware/
*/

#include &lt;avr/io.h&gt;
#include &lt;avr/interrupt.h&gt;

int main(void)
{

  //Setup the clock
  cli();			//Disable global interrupts
  TCCR1B |= 1&lt;&lt;CS11 | 1&lt;&lt;CS10;	//Divide by 64
  OCR1A = 15624;		//Count 15624 cycles for 1 second interrupt
  TCCR1B |= 1&lt;&lt;WGM12;		//Put Timer/Counter1 in CTC mode
  TIMSK1 |= 1&lt;&lt;OCIE1A;		//enable timer compare interrupt
  sei();			//Enable global interrupts

  //Setup the I/O for the LED

  DDRD |= (1&lt;&lt;0);		//Set PortD Pin0 as an output
  PORTD |= (1&lt;&lt;0);		//Set PortD Pin0 high to turn on LED

  while(1) { }			//Loop forever, interrupts do the rest
}

ISR(TIMER1_COMPA_vect)		//Interrupt Service Routine
{
  PORTD ^= (1&lt;&lt;0);		//Use xor to toggle the LED
}</pre></p>
<p>The first few lines are comments for the benefit of human eyes and will not be used by the microcontroller. Comments in C are prefaced by two slashes (//) for single line comments or encased in slash-star (/*) and star-slash (*/) pairs for multiline comments. It&#8217;s a good idea to write comments that detail the program, what it does, what hardware it runs on, and any other helpful information. I find that I often reuse code from past projects and a bit of information at the top of the file helps locate what I&#8217;m looking for quickly.</p>
<p><strong>The Includes</strong></p>
<p>The next thing you see are the includes:</p>
<p><pre class="brush: cpp; wrap-lines: false;">#include &lt;avr/io.h&gt;
#include &lt;avr/interrupt.h&gt;</pre></p>
<p>Includes tell the compiler that we&#8217;re going to be using things from other files. In this case, two files from <a href="http://www.nongnu.org/avr-libc/user-manual/">AVR Libc</a> that came with the cross-compiling toolchain we installed in <a href="http://hackaday.com/2010/10/23/avr-programming-introduction/">Part 1</a>. These are C files that allow us to use human-readable (and rememberable!) code when working with the hardware on the chip. The io.h file rolls header files for all of the supported AVR chips into one. We define what processor we&#8217;re using in our makefile, and the appropriate header file is automatically chosen from io.h when we compile our code later in this tutorial.</p>
<p>In our example code I&#8217;ve used names like DDRD, PORTD, TCCR1B, OCR1A, TIMSK1, etc. All of these have addresses that are pointed to using the io.h file. This allows us to call pins on the chip by the names like PORTD which are the same across all AVR variants instead of register addresses like 0x0B which has different functions on different chips. Most likely you&#8217;ll need to include io.h in every AVR program you use, and doing so makes your code more portable. The interrupt.h file is only needed if you are using interrupts, something we&#8217;ll talk about as we look at the next code block</p>
<p><strong>Setting up the clock for use with interrupts</strong></p>
<p>Processors need a clock signal in order to work. AVR chips can use external clocks like a crystal oscillator or a ceramic resonator, but they come from the factory configured to use the internal RC oscillator as the system clock (read more on page 28 of the datasheet). The internal RC oscillator of the ATmega168 runs at approximately 8.0 MHz depending on voltage stability and temperature. It also ships with the DIV8 fuse enabled which divides the clock signal down to 1.0 MHz. For the sample program I wanted an LED to blink between on and off, changing about once a second. Here&#8217;s the code block that sets that functionality up:</p>
<p><pre class="brush: cpp; wrap-lines: false;">  //Setup the clock
  cli();			//Disable global interrupts
  TCCR1B |= 1&lt;&lt;CS11 | 1&lt;&lt;CS10;	//Divide by 64
  OCR1A = 15624;		//Count 15624 cycles for 1 second interrupt
  TCCR1B |= 1&lt;&lt;WGM12;		//Put Timer/Counter1 in CTC mode
  TIMSK1 |= 1&lt;&lt;OCIE1A;		//enable timer compare interrupt
  sei();			//Enable global interrupts
</pre></p>
<p>The very first line has something to do with interrupts. An interrupt is a great feature of microprocessors. Basically you tell the chips to watch for a certain condition. When it matches that condition it will stop what it is doing no matter where it is, and run a different set of code called an Interrupt Service Routine (ISR). Because we are about to change some settings having to do with interrupts, we don&#8217;t want anything (like an interrupt) to stop us in the middle of this process. I&#8217;ve used a command that is available to us because we included interrupt.h at the beginning of our file. The command is <a href="http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html#ga68c330e94fe121eba993e5a5973c3162">cli();</a> which disables all interrupts. Once we are done with our settings we <span style="text-decoration:underline;">must</span> remember to enable them again, using the <a href="http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html#gaad5ebd34cb344c26ac87594f79b06b73">sei();</a> command. You can see I&#8217;ve done that at the bottom of this code block</p>
<p>Now we want to watch for the passage of 1 second worth of time. The four lines in between these two commands are used to setup a counter to do just that. Because the internal oscillator is running at 1 MHz, or 1 Million cycles per second, we must trigger an interrupt every 1 million cycles. The biggest timer this chip has is 16-bits which can only count from 0 to 65,535. In other words, we don&#8217;t have a timer that can count high enough to measure such a large number of cycles.</p>
<p>Fortunately, we have the option to use a divider with our timer, called a prescaler. To do so we look in the datasheet on page 134 to see a chart outlining the clock select. It shows prescaler options which divide the system clock by 1, 8, 64, 256, and 1024. Knowing that we want to count 1,000,000 cycles we can use a bit of math to choose the best prescaler:</p>
<pre style="padding-left:30px;">1,000,000 / 1 = 1,000,000
1,000,000 / 8 = 125,000
1,000,000 / 64 = 15,625
1,000,000 / 256 = 3,906.25
1,000,000 / 1024 = 976.5625</pre>
<p>The math only leaves us with one choice. That&#8217;s because using a prescaler of 1 or 8 results in a number of cycles that is larger than <a href="http://www.google.com/#hl=en&amp;expIds=17259,24416,26637,27060,27284,27357&amp;sugexp=ldymls&amp;xhr=t&amp;q=2%5E16&amp;cp=4&amp;pf=p&amp;sclient=psy&amp;aq=f&amp;aqi=h1g4&amp;aql=&amp;oq=2%5E16&amp;gs_rfai=&amp;pbx=1&amp;fp=2304850557947867">65,536</a> so our 16-bit timer can&#8217;t count high enough. Prescalers of 256 and 1024 give results that are not a whole number. If we don&#8217;t use a whole number we introduce an inaccuracy in our timing because we can&#8217;t measure a fraction of a cycle. A prescaler of 64 meets both our needs, being a whole number that is smaller than the limits of our 16-bit counter.</p>
<p>How can we set up this prescaler? The datasheet tells all. Looking at &#8220;Timer/Counter1 Control Register B&#8221; (TCCR1B) which spans pages 133 and 134 we can find the answer. Diagram 15-5 shows a clock settings table. In our case we need to set CS10 and CS11 to &#8217;1&#8242; on the TCCR1B register. To do this we use an OR operator and Left Shift a &#8217;1&#8242; to the location of the CS10 and CS11 bits:</p>
<p><pre class="brush: cpp; wrap-lines: false;">  TCCR1B |= 1&lt;&lt;CS11 | 1&lt;&lt;CS10;</pre></p>
<p>Because this is our first real bitwise math let&#8217;s look at it in depth. First off, we&#8217;re only setting two bits on the register so we do not want to use just an equals sign. If I had done that, this command would force all other bits to zero. Instead, I use shorthand code to use the OR operator to compare TCCR1B with a bitmask containing a &#8217;1&#8242; at the correct location for the CS10 and CS11 bits. Any other bits on the  TCCR1B register that are set to &#8217;1&#8242; will remain so.</p>
<p>I&#8217;ve created a bitmask to the right of the |= operator. As I talked about in the includes section, CS10 and CS11 are defined in io.h. But looking at the TCCR1B register we can see that CS10 is on bit 0 and CS11 is on bit 1. If you solved your math problem longhand it would look like this:</p>
<pre>1&lt;&lt;CS11 | 1&lt;&lt;CS10;
1&lt;&lt;1 | 1&lt;&lt;0;
0b00000010 | 0b00000001;
0b00000011;</pre>
<p>This is the method that you use for setting any bit for any purpose. It really is that simple. Build a bitmask and apply it to a register or variable. Just remember to be careful about preserving data that might already be stored on a register or in a value but using the OR operator during assignment.</p>
<p>Now that we have a divided clock source for the counter, and a target number of 15,625 cycles to watch for thanks to the math above. We can use one of the modes of Timer1, the Clear Timer on Compare Match (CTC), to trigger an interrupt at that exact cycle count. Take a look at page 121 of the datasheet and you will see we need to set OCR1A to our target value. We&#8217;ll set it to 15,624, one less than our cycle count because microcontroller timers start counting with the number zero, not one. This time we will use an equal sign because there are no other values stored in this register:</p>
<p><pre class="brush: cpp; wrap-lines: false;">  OCR1A = 15624;</pre></p>
<p>I also need to set the timer mode I want to use. Table 15-4 on page 133 has a lot of information on this. As discussed before, I want to use CTC mode so that narrows my choices on this table down to just two. I can choose between those because I know I&#8217;m using the value of OCR1A as the largest number the timer should count to, or TOP. The chart tells me to set the WGM12 bit on the TCCR1B register to 1.:</p>
<p><pre class="brush: cpp; wrap-lines: false;">  TCCR1B |= 1&lt;&lt;WGM12;</pre></p>
<p>This could have been done at the same time as the timer prescaler because they&#8217;re set on the same register. But it&#8217;s fine to do it in two steps because I&#8217;ve used the OR operator, making sure I&#8217;m not changing any of the other bits on this register.</p>
<p>The next step can be a &#8220;gotcha&#8221; for new developers. Everything is now setup correctly for our timer to trigger an interrupt at the appropriate interval. But if we don&#8217;t set the &#8220;interrupt enable&#8221; flag for that particular event, the interrupt will never happen. Page 136 of the datasheet cryptically discusses the use of the Timer/Counter Output Compare A Match Interrupt Enable. Setting this bit to 1 will enable the CTC interrupt we are planning to use:</p>
<p><pre class="brush: cpp; wrap-lines: false;">   TIMSK1 |= 1&lt;&lt;OCIE1A;</pre></p>
<p>Simple right? Do it a few times and it will be. There&#8217;s a lot of functionality with the timers on these chips and wading through the register settings is the price you pay for that power. But now we&#8217;re ready to go with 1-second interrupts.</p>
<p><strong>Initializing the Input/Output pins</strong></p>
<p>When an AVR chip resets, the pins are all placed in tri-state mode. At the beginning of the program any input and output pins need to be setup for their desired function. Starting on page 73 of the datasheet you can read about using pins as general input and output. There are three registers for each pin that we will generally be concerned with: Data Direction Register (DDR), Port register (PORT) and Pin register (PIN). Each of these will be suffixed with a letter corresponding to which set of pins we are working with. I&#8217;ve connected the LED to Port D so I need to work with DDRD, PORTD, and if I was using inputs, PIND.</p>
<p><pre class="brush: cpp; wrap-lines: false;">  //Setup the I/O for the LED

  DDRD |= (1&lt;&lt;0);		//Set PortD Pin0 as an output
  PORTD |= (1&lt;&lt;0);		//Set PortD Pin0 high to turn on LED</pre></p>
<p>The code above is used to set up an LED. Setting a bit on DDRD to 1 will make the corresponding pin an output. Setting it to zero would make it an input. Here I&#8217;ve set up an output because we are driving an LED. Outputs can be turned on or off by setting a 1 or a 0 to the PORT register respectively. So above I&#8217;ve used PORTD to turn on bit 0 which corresponds to pin connected to the LED.</p>
<p>If we were using a pin as an input the PORT register would be used to enable or disable an internal pull-up resistor and the PIN register would be used to measure the logic value currently present on that pin. Table 13-1 on page 74 shows the various states of I/O pins, but I&#8217;ll cover it more in part 4 of this series.</p>
<p><strong>The Loop</strong></p>
<p>Embedded programs must have an infinite loop that prevents the program from getting to the end and exiting. That&#8217;s because if our program exits the chip will just sit there and do nothing (after all, there&#8217;d be no program running). In this case I don&#8217;t need the loop to do anything since I&#8217;ve already set up the hardware and I&#8217;m using an interrupt to blink the LED:</p>
<p><pre class="brush: cpp; wrap-lines: false;">  while(1) { }			//Loop forever, interrupts do the rest</pre></p>
<p>I&#8217;ll add functionality to the loop in Part 4 or the series, but for now the &#8216;while(1)&#8217; loop just traps the program and does nothing else.</p>
<p><strong>Handling the interrupt</strong></p>
<p>Everything is now setup and ready to go, but nothing will happen unless we write code that does something after the interrupt happens. This is called an Interrupt Service Routine (ISR). The rest of the code is halted and this routine is run. It is best to keep this as short as possible, which is easy here because we just need to toggle the LED:</p>
<p><pre class="brush: cpp; wrap-lines: false;">ISR(TIMER1_COMPA_vect)		//Interrupt Service Routine
{
  PORTD ^= (1&lt;&lt;0);		//Use xor to toggle the LED
}</pre></p>
<p>If you look at page 62 of the datasheet you can see that the interrupt source for Timer/Counter1 Compare A match is called &#8220;TIMER1 COMPA&#8221;. We take this and use it as the input variable for the ISR, replacing spaces with underscores and adding a lower case &#8220;vect&#8221; at the end. This is how the compiler knows which ISR belongs to different interrupt sources. As for the LED itself, I&#8217;ve used the XOR operator and a bitmask. The bitmask ensures that only bit 0 will be changed.</p>
<h2>Compiling Code</h2>
<p>Before we leave this segment of the tutorial series you should give your compiler a test-drive.</p>
<p>The compiler takes our C code and turns it into a file that can be written to the microcontroller. The ins and outs of a compiler get a bit hairy and this isn&#8217;t the time to explain those details. But as you learn to write embedded code you should make an effort to also learn how this code will be interpreted by the compiler. Doing so will prevent a lot of headaches caused by optimization (the compiler trying to streamline your bloated C code) and it will allow you to make the most of your hardware both in terms of programming space, and functionality.</p>
<p>But for now there&#8217;s a make file included in <a href="https://github.com/szczys/had_AVRtut_2/archives/master">the example source from Part 2</a>. If you haven&#8217;t already, unzip that package and navigate to the &#8216;src&#8217; directory. There are two files in that directory, main.c and makefile. A makefile is a way to automate the compiling process. This one compiles, links, and programs a C code source file. If you look at the makefile you&#8217;ll notice that there are several user settings near the top. You need to setup the microprocessor for which you&#8217;ve written code, the name of the source file you&#8217;ve written (TARGET = main), the programmer you&#8217;re using (from the AVRdude list discussed in Part 2), and the port path for the programmer.</p>
<p>If you type &#8216;make&#8217; you should be able to compile the example program. Unless you have an AVR Dragon programmer and you&#8217;re running Linux you&#8217;ll get an error when it tries to program the chip, but it should compile the code and output several extra files:</p>
<p><pre class="brush: bash; wrap-lines: false;">$  ls -la
total 84
drwxr-xr-x 2 mike mike  4096 2010-11-04 14:20 .
drwxr-xr-x 3 mike mike  4096 2010-11-01 14:55 ..
-rw-r--r-- 1 mike mike   894 2010-10-24 12:34 main.c
-rw-r--r-- 1 mike mike    23 2010-11-04 14:20 main.d
-rw-r--r-- 1 mike mike    13 2010-11-04 14:20 main.eep
-rwxr-xr-x 1 mike mike  7121 2010-11-04 14:20 main.elf
-rw-r--r-- 1 mike mike   750 2010-11-04 14:20 main.hex
-rw-r--r-- 1 mike mike  5224 2010-11-04 14:20 main.lss
-rw-r--r-- 1 mike mike  5171 2010-11-04 14:20 main.lst
-rw-r--r-- 1 mike mike 14464 2010-11-04 14:20 main.map
-rw-r--r-- 1 mike mike  3972 2010-11-04 14:20 main.o
-rw-r--r-- 1 mike mike  1454 2010-11-04 14:20 main.sym
-rw-r--r-- 1 mike mike 10235 2010-10-24 10:44 makefile</pre></p>
<p>&#8216;main.hex&#8217; is the file that you can program onto the microcontroller. This makefile is extremely versatile. You can also see that it output &#8216;main.eep&#8217; which can be used to program the EEPROM on the chip if your code includes default data stored in the EEPROM. It can also be altered to output an assembler file, or binaries in different formats.</p>
<p>If you&#8217;re compiler didn&#8217;t spit out this information, there&#8217;s something wrong with your toolchain. Use your friend Google to search for any error messages and see if you can&#8217;t get things fixed up. Another great exercise would be to modify this file to work with your programmer. If you managed to get AVRdude working in Part 2 of this series, this alteration is as simple as changing the makefile to use those same settings.</p>
<h2>Conclusion</h2>
<p>That&#8217;s it for now. In the next installment of this series I&#8217;ll be talking about fuse bits, writing our own code, and I&#8217;ll try to touch on many of the different peripheral features of this chip. I&#8217;m plan to augment the original circuit with a few more LEDs (so make sure you have at least 8 of them and their matching resistors) along with adding a button for input. Thanks for reading!</p>
<h2><strong>Follow Me</strong></h2>
<p><a href="http://twitter.com/szczys">@szczys</a></p>
<h2>Resources</h2>
<p>Atmel AVR <a href="http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf">ATmega168 Datasheet</a> (PDF)</p>
<p><a href="http://www.nongnu.org/avr-libc/user-manual/">AVR Libc manual</a></p>
<br />Filed under: <a href='http://hackaday.com/category/how-to/'>how-to</a>, <a href='http://hackaday.com/category/microcontrollers/'>Microcontrollers</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/29460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/29460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/29460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/29460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/29460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/29460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/29460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/29460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/29460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/29460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/29460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/29460/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/29460/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/29460/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=29460&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/11/05/avr-programming-03-reading-and-compiling-code/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/10/avr-programming-for-everyone.jpg" medium="image">
			<media:title type="html">avr-programming-for-everyone</media:title>
		</media:content>
	</item>
		<item>
		<title>C Sharp Development 101 &#8211; Part 2: Toolbox Controls</title>
		<link>http://hackaday.com/2010/10/15/c-sharp-development-101-part-2-toolbox-controls/</link>
		<comments>http://hackaday.com/2010/10/15/c-sharp-development-101-part-2-toolbox-controls/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 19:00:36 +0000</pubDate>
		<dc:creator>Greg R. Jacobs</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[toolbox]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=28984</guid>
		<description><![CDATA[In this tutorial we are going to start finding out more about the toolbox we utilized in the previous tutorial.  The Controls available in the toolbox are quite extensive and allow users to simplify a variety of everyday tasks such as manually creating and instantiating a textbox on a windows form.  At the end of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=28984&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:center;"><img class="alignnone size-full wp-image-29355" title="ctools" src="http://hackadaycom.files.wordpress.com/2010/10/ctools.jpg" alt="" width="457" height="120" /></div>
<div style="text-align:left;">In this tutorial we are going to start finding out more about the toolbox we utilized in the <a href="http://bit.ly/CSharp1011">previous tutorial</a>.  The Controls available in the toolbox are quite extensive and allow users to simplify a variety of everyday tasks such as manually creating and instantiating a textbox on a windows form.  At the end of this tutorial you should be comfortable finding Controls in the Visual Studio Toolbox, alter or produce code to link tools together using event handlers and ultimately get a better sense of Visual Studio, it’s layout and how to easily navigate it.</div>
<div style="text-align:left;"><span id="more-28984"></span></div>
<div style="text-align:left;">
<p>To start we are going to create a new Windows Forms Application project in a new solution that will be called ApplicantRegistration.  After the project is created we need to change the name of the form from Form1 to main and change the name on the top of the form to Applicant Registration under text in the Properties tab.  Then we can start adding in labels and changing Text and Name Properties for:</p>
<ul>
<li>First Name (Text: First Name, Name: lblFirstName)</li>
<li>Last Name (Text: Last Name, Name: lblLastName)</li>
<li>Address (Text: Address, Name: lblAddress)</li>
<li>City (Text: City, Name: lblCity)</li>
<li>Zip Code (Text: Zip Code, Name: lblZipCode)</li>
<li>Email Address (Text: Email Address, Name: lblEmail)</li>
<li>Phone Number (Text: Phone Number, Name: lblPhone)</li>
</ul>
<p>After the labels are completed, we need to add the text-boxes that are going to coincide with the labels. The textboxes are going to have to be altered to make the names of each textbox readable when we do decide to code some guts.  The following are the textboxes that must be added to the form and the changes to the name property as well:</p>
<ul>
<li>First Name (Name: txtFirstName)</li>
<li>Last Name (Name: txtLastName)</li>
<li>Address (Name: txtAddress)</li>
<li>City (Name: txtCity)</li>
<li>Zip Code (Name: txtZipCode)</li>
<li>Email Address (Name: txtEmail)</li>
<li>Phone Number (Name: txtPhone)</li>
</ul>
<p>After this has been done the result should look like this after moving the labels and text boxes around the form:</p>
<p><a href="http://hackadaycom.files.wordpress.com/2010/10/applicant.png"><img class="aligncenter size-full wp-image-28985" title="Applicant" src="http://hackadaycom.files.wordpress.com/2010/10/applicant.png" alt="" width="314" height="322" /></a></p>
<p>We now want to add the button that we are going to utilize to enter the forms data into a storage container.  We need to drag the button from the toolbox onto the form and change the Text to “Submit” and the name to btnSubmit.  After this is done we can double click on the button which will take us to the code that will be utilized when the user clicks the button.  To do this we are going to start out by clearing all of the form data so when the user presses submit the boxes clear and are ready for another entry.  To do this our code will look like something along the lines of:</p>
<p>
private void btnSubmit_Click(object sender, EventArgs e)
 {
 txtFirstName.Text = &quot;&quot;;
 txtLastName.Text = &quot;&quot;;
 txtAddress.Text = &quot;&quot;;
 txtCity.Text = &quot;&quot;;
 txtZipCode.Text = &quot;&quot;;
 txtEmail.Text = &quot;&quot;;
 txtPhone.Text = &quot;&quot;;
 }
</p>
<p>After the code for the button is made we want to extend the  form to the right and add some controls for birth-date and gender.  We will start by making labels for Birthday and Gender respectively.  After we have created the two labels we are going to drag three combo boxes onto the form, one for the day, month and year.  When renaming objects on forms I tend to shorten what the object is into a minimum of two letters and a maximum of four.  The final result would be cbYear, cbMonth and cbDay respectively.  We can now drag two radio buttons onto the form and rename the text of one to Male and the other to Female.  After these have been positioned we can code the methods to populate the dates and tie the two radio buttons together.</p>
<p>The first item on the agenda will be the two radio buttons.  We are going to tie them together so that the two cannot be both checked.  To do this we need to check and see if the opposite radio button is checked.  We will do this by utilizing the CheckedChanged event handler for both radio buttons and this code:</p>
<p><pre class="brush: csharp;">
private void rbMale_CheckedChanged(object sender, EventArgs e)
 {
 if (rbMale.Checked == true)
 rbFemale.Checked = false;
 else
 rbFemale.Checked = true;
 }

 private void rbFemale_CheckedChanged(object sender, EventArgs e)
 {
 if (rbFemale.Checked == true)
 rbMale.Checked = false;
 else
 rbMale.Checked = true;
 }

</pre></p>
<p>Next we are going to populate the combo boxes we dragged onto the form earlier.  To do this we are going to have to check which one is picked and populate the days for that particular month.  Leap Years are an advanced function that will be implemented in the next tutorial but will be important to the final build.  We are also going to code a for loop to add the years 1900 to 2010 dynamically on the forms startup.  We can do both of these by utilizing main_Load and the cbMonth_SelectedValueChanged event handlers.  The code will look something like this:</p>
<p><pre class="brush: csharp;">
private void main_Load(object sender, EventArgs e)
{
 for (int i = 2010; i &gt;= 1900; --i)
 cbYear.Items.Add(i);
}

private void cbMonth_SelectedValueChanged(object sender, EventArgs e)
 {
 cbDay.Items.Clear();
 if (cbMonth.Text == &quot;September&quot; || cbMonth.Text == &quot;April&quot; || cbMonth.Text == &quot;June&quot; || cbMonth.Text == &quot;November&quot;)
 for (int i = 1; i &lt;= 30; ++i)
 cbDay.Items.Add(i);
 else if (cbMonth.Text == &quot;January&quot; || cbMonth.Text == &quot;March&quot; || cbMonth.Text == &quot;May&quot; || cbMonth.Text == &quot;July&quot; || cbMonth.Text == &quot;August&quot; || cbMonth.Text == &quot;October&quot; || cbMonth.Text == &quot;December&quot;)
 for (int i = 1; i &lt;= 31; ++i)
 cbDay.Items.Add(i);Day.Items.Add(i);
 else
 for (int i = 1; i &lt;= 28; ++i)
 cbDay.Items.Add(i);
 }

 private void rbMale_CheckedChanged(object sender, EventArgs e)
 {
 if (rbMale.Checked == true)
 rbFemale.Checked = false;
 else
 rbFemale.Checked = true;
 }

</pre></p>
<p>The final form should look something along the lines of this now:</p>
<p><a href="http://hackadaycom.files.wordpress.com/2010/10/fullregistration.png"><img class="aligncenter size-large wp-image-29251" title="fullregistration" src="http://hackadaycom.files.wordpress.com/2010/10/fullregistration.png?w=450&#038;h=253" alt="" width="450" height="253" /></a></p>
<p>The next logical step would be to include code to output this data to a text file or even a database.  We will cover this in the next tutorial using both output methods.  The first will be a text file as mentioned and the database of choice will be a mySQL database which we will go over installing in the next post.  If you are eager you can acquire the program <a href="http://bit.ly/mySQLDown">here </a>and install it before the next tutorial.  We could have used Microsoft&#8217;s Access database program but it is not free and the main objective of these tutorials is cheap development.</p>
<p>After this is done we can run the program by pressing F5 and enter in some test data.  Once all of the data is entered we can press the submit button and the data &#8211; if done correctly &#8211; should disappear.  If you can’t wait until the next tutorial, here is some reading on <a href="http://bit.ly/ConnString">connection strings</a> and <a href="http://bit.ly/IOTextFile">reading and writing to a text file</a> to get you up to speed.  Until next tutorial, Happy Hacking!</p>
</div>
<br />Filed under: <a href='http://hackaday.com/category/software-development/'>Software Development</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/28984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/28984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/28984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/28984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/28984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/28984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/28984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/28984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/28984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/28984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/28984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/28984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/28984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/28984/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=28984&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/10/15/c-sharp-development-101-part-2-toolbox-controls/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		<georss:point>43.002684 -81.214990</georss:point>
		<geo:lat>43.002684</geo:lat>
		<geo:long>-81.214990</geo:long>
		<media:content url="" medium="image">
			<media:title type="html">greggers120588</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/10/ctools.jpg" medium="image">
			<media:title type="html">ctools</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/10/applicant.png" medium="image">
			<media:title type="html">Applicant</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/10/fullregistration.png?w=450" medium="image">
			<media:title type="html">fullregistration</media:title>
		</media:content>
	</item>
		<item>
		<title>Open Call: send us your Debounce code</title>
		<link>http://hackaday.com/2010/10/13/open-call-send-us-your-debounce-code/</link>
		<comments>http://hackaday.com/2010/10/13/open-call-send-us-your-debounce-code/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 20:11:32 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[HackIt]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[debounce]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[switch]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=29271</guid>
		<description><![CDATA[If you&#8217;ve ever designed an embedded system with at least one button you&#8217;ve had to deal with button debouncing. This is also know as contact bounce, a phenomenon where a button press can be registered as multiple button presses if not handled correctly. One way to take care of this is with a hardware filter built from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=29271&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-29272" title="debounce-waveform" src="http://hackadaycom.files.wordpress.com/2010/10/debounce-waveform.jpg" alt="" width="470" height="244" /></p>
<p>If you&#8217;ve ever designed an embedded system with at least one button you&#8217;ve had to deal with button debouncing. This is also know as <a href="http://en.wikipedia.org/wiki/Debounce#Contact_bounce">contact bounce</a>, a phenomenon where a button press can be registered as multiple button presses if not handled correctly. One way to take care of this is with a hardware filter built from a resistor-capacitor setup, or by using a couple of NAND gates. We find that [Jack Ganssle] put together the most comprehensive and <a href="http://www.ganssle.com/debouncing.htm">approachable look at contact bounce</a> which you should read through if you want to learn more.</p>
<p>We&#8217;re interested in software solutions for debouncing buttons. This seems to be <a href="http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;file=viewtopic&amp;t=33821">one of the most common forum questions</a> but it can be hard to find answers in the form of reliable code examples. Do you have debounce code that you depend on in every application? Are you willing to share it with the world? We&#8217;d like to gather as many examples as possible and publish them in one-post-to-rule-them-all.</p>
<h2>Send your debounce code to: <a href="mailto:debounce@hackaday.com">debounce@hackaday.com</a></h2>
<p>Here&#8217;s some guidelines to follow:</p>
<ul>
<li><strong>Please only include debounce code.</strong> Get rid of other unrelated functions/etc.</li>
<li><strong>You should send C code.</strong> If you want to also send an assembly code version that&#8217;s fine, but it must be supplementary to the C code.</li>
<li><strong>Please comment your code.</strong> This will help others understand and use it. You may be tempted to explain the code in your email but this info is best placed in the code comments</li>
<li><strong>Cite your sources.</strong> If you adapted this code from someone else&#8217;s please include a note about that in the code comments.</li>
</ul>
<p>As an example we&#8217;ve included one of our favorite sets of debounce code after the break. Please note how it follows the guidelines listed above.</p>
<p><span id="more-29271"></span></p>
<p><pre class="brush: cpp; wrap-lines: false;">/*--------------------------------------------------------------------------
10/13/2010: Button debounce code by Mike Szczys

based on &quot;danni debounce&quot; code by Peter Dannegger:
http://www.avrfreaks.net/index.php?name=PNphpBB2&amp;file=viewtopic&amp;p=189356#189356

This code detects and debounces button presses. It is tailored for use with
AVR microcontrollers but I've adapted it for other architectures easily and
successfully. It can be modified to use all eight bits on the same port
for up to eight buttons.

The interrupt service routine (ISR) at the bottom uses binary counter
variables (ct0 and ct1) to check the buttons once every 10ms until 40ms has
passed. If the button registeres the first and last times it reads it as
a keypress. There is no functionality in this code for detecting a held
button.
--------------------------------------------------------------------------*/

// F_CPU used by debounce to calculate 10ms interrupts
#define F_CPU 1200000

#include &lt;avr/io.h&gt;
#include &lt;avr/interrupt.h&gt;

//define pins used by buttons
#define KEY_DDR		DDRB
#define KEY_PORT	PORTB
#define KEY_PIN		PINB
#define KEY0		1	//Button on PB1
#define KEY1		2	//Button on PB2

//Debounce variables
unsigned char debounce_cnt = 0;
volatile unsigned char key_press;
unsigned char key_state;

/*--------------------------------------------------------------------------
  Prototypes
--------------------------------------------------------------------------*/
unsigned char get_key_press( unsigned char key_mask );
void init_timers(void);
void init_io(void);

/*--------------------------------------------------------------------------
  FUNC: 10/13/10 - Used to read debounced button presses
  PARAMS: A keymask corresponding to the pin for the button you with to poll
  RETURNS: A keymask where any high bits represent a button press
--------------------------------------------------------------------------*/
unsigned char get_key_press( unsigned char key_mask )
{
  cli();			// read and clear atomic !
  key_mask &amp;= key_press;	// read key(s)
  key_press ^= key_mask;	// clear key(s)
  sei();			// enable interrupts
  return key_mask;
}

/*--------------------------------------------------------------------------
  FUNC: 10/13/10 - Sets and starts a system timer
  PARAMS: NONE
  RETURNS: NONE
--------------------------------------------------------------------------*/
void init_timers(void)
{
  cli();			// read and clear atomic !
  //Timer0 for buttons
  TCCR0B |= 1&lt;&lt;CS02 | 1&lt;&lt;CS00;	//Divide by 1024
  TIMSK0 |= 1&lt;&lt;TOIE0;		//enable timer overflow interrupt
  sei();			// enable interrupts
}

/*--------------------------------------------------------------------------
  FUNC: 10/13/10 - Initialize input and output registers
  PARAMS: NONE
  RETURNS: NONE
--------------------------------------------------------------------------*/
void init_io(void)
{
  //Setup Buttons
  KEY_DDR &amp;= ~((1&lt;&lt;KEY0) | (1&lt;&lt;KEY1));	//Set pins as input
  KEY_PORT |= (1&lt;&lt;KEY0) | (1&lt;&lt;KEY1);	//enable pull-up resistors
}

/*--------------------------------------------------------------------------
  FUNC: 10/13/10 - Main
--------------------------------------------------------------------------*/
int main(void)
{
  init_timers();	//start the timer
  init_io();		//setup the buttons

  for (;;) //loop forever
  {
    if( get_key_press( 1&lt;&lt;KEY0 ))
    {
      //KEY0 press detected. Do something here
    }

    if (get_key_press( 1&lt;&lt;KEY1 ))
    {
      //KEY1 press detected. Do something here
    }
  }
}

//--------------------------------------------------------------------------
ISR(TIM0_OVF_vect)           // interrupt every 10ms
{
  static unsigned char ct0, ct1;
  unsigned char i;

  //TCNT0 is where TIMER0 starts counting. This calculates a value based on
  //the system clock speed that will cause the timer to reach an overflow
  //after exactly 10ms
  TCNT0 = (unsigned char)(signed short)-(((F_CPU / 1024) * .01) + 0.5);   // preload for 10ms interrupts

  i = key_state ^ ~KEY_PIN;    // key changed ?
  ct0 = ~( ct0 &amp; i );          // reset or count ct0
  ct1 = ct0 ^ (ct1 &amp; i);       // reset or count ct1
  i &amp;= ct0 &amp; ct1;              // count until roll over ?
  key_state ^= i;              // then toggle debounced state
  key_press |= key_state &amp; i;  // 0-&gt;1: key press detect
}</pre></p>
<p>[Photo credit: <a href="http://www.ganssle.com/debouncing.htm">Jack Ganssle</a>]</p>
<br />Filed under: <a href='http://hackaday.com/category/hackit/'>HackIt</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/29271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/29271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/29271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/29271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/29271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/29271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/29271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/29271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/29271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/29271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/29271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/29271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/29271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/29271/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=29271&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/10/13/open-call-send-us-your-debounce-code/feed/</wfw:commentRss>
		<slash:comments>75</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/10/debounce-waveform.jpg" medium="image">
			<media:title type="html">debounce-waveform</media:title>
		</media:content>
	</item>
		<item>
		<title>C Sharp Development 101 &#8211; Part 1: Hello World</title>
		<link>http://hackaday.com/2010/09/30/c-sharp-development-101-part-1-hello-world/</link>
		<comments>http://hackaday.com/2010/09/30/c-sharp-development-101-part-1-hello-world/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 21:00:47 +0000</pubDate>
		<dc:creator>Greg R. Jacobs</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=28702</guid>
		<description><![CDATA[In this tutorial we are going to get up close with the Visual Studio 2010 environment. We will learn how to make a console application as well as a form to display our hello world applications.  This will give us an opportunity to view 2 types of solutions of the many available in Visual Studio. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=28702&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div style="text-align:center;">
<p id="internal-source-marker_0.4662012970075011"><img class="alignnone size-full wp-image-28788" title="cworld" src="http://hackadaycom.files.wordpress.com/2010/09/cworld.jpg" alt="" width="457" height="120" /></p>
</div>
<p>In this tutorial we are going to get up close with the Visual Studio 2010 environment. We will learn how to make a console application as well as a form to display our hello world applications.  This will give us an opportunity to view 2 types of solutions of the many available in Visual Studio.  We will start making the console application first then progress to the forms application.</p>
<p>First we must  understand the development environment we are going to use.  On the far left side is the toolbox panel.  This panel gives us access to a lot of controls  that can be used by the Windows Forms.  Next is the Solution Explorer that will allow us to navigate the projects and files we are going to create in this Solution.  The Properties panel is directly under my Solution Explorer and will allow us to change properties of controls and of the form we will create later on.  If any of these are not being displayed they can be retrieved from the View menu at the top under Other Windows.  For more information on the Visual Studio IDE visit <a href="http://bit.ly/VSIDEHelp">MSDN </a>and search for the specific questions you are having.</p>
<p><span id="more-28702"></span></p>
<p style="text-align:center;"><a href="http://hackadaycom.files.wordpress.com/2010/09/visualstudioide.png"><img class="size-thumbnail wp-image-28703 alignnone" title="VisualStudioIDE" src="http://hackadaycom.files.wordpress.com/2010/09/visualstudioide.png?w=128&#038;h=69" alt="" width="128" height="69" /></a></p>
<p>Then we need to start the Visual Studio environment and create a new project.  To do this we will go to File then navigate to New Project and click it.  A dialog box will appear and ask you which project you would like to include in your solution that will be automatically created for your project.  We need to use the Console Application.  Next we need to replace the box at the bottom where it says <strong>ConsoleApplication1 </strong>with <strong>HelloWorldConsole </strong>and then after the project and solution is created press <em>CTRL-S</em> to change the name of the solution file to <strong>HelloWorld</strong> in the box under the project name box and press <strong>OK</strong>.  This will create a project inside a Solution file. The solution file acts like the glue that binds all projects included in the solution file together.  Later on we will discover how this is beneficial for creating projects and making class files that reference DLL’s that we will code.</p>
<p>Once the project is created we are going to edit the program.cs file.  After you have open the program.cs we are going to add the text necessary to have the program output “Hello World” to the console.  To do this we will need to add the line <strong>Console.Out.WriteLine(&#8220;Hello World!&#8221;); </strong>inside the static void main curly brackets.  After this is complete we can now build and attempt to build our solution.  To build the solution we need to press <em>CTRL + SHIFT + B </em>and the build process will being.  After the build is a success we can now run the Console Application by pressing <em>CTRL + F5.</em> This will display a command prompt with “Hello World!”.</p>
<p style="text-align:center;"><a href="http://hackadaycom.files.wordpress.com/2010/09/helloworldconsole.png"><img class="aligncenter size-thumbnail wp-image-28704" title="HelloWorldConsole" src="http://hackadaycom.files.wordpress.com/2010/09/helloworldconsole.png?w=128&#038;h=64" alt="" width="128" height="64" /></a></p>
<p>Here is the source code for <em>program.cs:</em></p>
<p><pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloWorldConsole
{
class Program
{
static void Main(string[] args)
{
Console.Out.WriteLine(&quot;Hello World!&quot;);
}
}
}

</pre></p>
<p>We can now move on to the windows forms application of Hello World.  To do this, we need to go to the solution and<strong> Right Click</strong>, then go to <strong>Add </strong>then click <strong>New Project</strong>.  For the project we will name it <strong>HelloWorldForms</strong>.  After the project is created we are going to delete the <em>Form1.cs</em> and we are going to create a new form by Right Clicking the HelloWorldForms Project, Navigating to <strong>Add</strong> then to <strong>New Item</strong>,  and when the dialog box appears we are going to pick <strong>Windows Form</strong>.</p>
<p>The name we are going to use is<em> main.cs</em> and press <strong>Add</strong>.  We now edit the <em>program.cs</em> to change the <strong>Form1</strong> that can be found in the file to <strong>main</strong>.  After the Windows Form is created we can start adding in Controls from the Toolbox.<br />
We are going to drag a label and a button onto the form portrayed in the middle of the program.  We are going to edit the properties here to make the text inside the label blank and the name of the label <strong>lbHelloWorld </strong>instead of <strong>label1</strong>.  After this is done we are going to want to edit the button we dropped onto the form earlier.  We will change the name of the button to <strong>btnHelloWorld </strong>and the Text of the button to <strong>Click Me!</strong>.  After this is done we are going to want to use an event handler to tie the button and the label together, so when the button is clicked “Hello World!” will appear in the label.</p>
<p>To make an event handler for the button we are going to go to the Properties panel and click the button on the top that looks like a lightning bolt.  This will take us to all o the event handlers that this button can handle.  We want the Click event handler, this will create the code required to handle a click event in the <em>main.cs</em>.  Now that the wrapper is there we can code the output to the label when the button is clicked.  Inside the curly brackets of “<strong>private void btnHelloWorld_Click</strong>” in<em> main.cs</em> input the following line of code to link the two Controls:</p>
<p><pre class="brush: csharp;">

lbHelloWorld.Text = “Hello World!”;

</pre></p>
<p>This will make the <em>main.cs</em> look like this:</p>
<p><pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HelloWorldForms
{
 public partial class main : Form
 {
 public main()
 {
 InitializeComponent();
 }

 private void btnHelloWorld_Click(object sender, EventArgs e)
 {
 lbHelloWorld.Text = &quot;Hello World!&quot;;
 }
 }
}
</pre></p>
<p>The <em>program.cs</em> should look like this:</p>
<p><pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace HelloWorldForms
{
 static class Program
 {
 /// &lt;summary&gt;
 /// The main entry point for the application.
 /// &lt;/summary&gt;
 [STAThread]
 static void Main()
 {
 Application.EnableVisualStyles();
 Application.SetCompatibleTextRenderingDefault(false);
 Application.Run(new main());
 }
 }
}
</pre></p>
<p>After all of this is completed we need to run the program by pressing <em>CTRL + F5</em> again. The screen that should appear should be something like this:</p>
<p style="text-align:center;"><a href="http://hackadaycom.files.wordpress.com/2010/09/helloworldformunclicked.png"><img class="aligncenter size-thumbnail wp-image-28705" title="HelloWorldFormUnclicked" src="http://hackadaycom.files.wordpress.com/2010/09/helloworldformunclicked.png?w=96&#038;h=96" alt="" width="96" height="96" /></a></p>
<p>The screen after the button has been pressed should look like this:</p>
<p style="text-align:center;"><a href="http://hackadaycom.files.wordpress.com/2010/09/helloworldformclicked.png"><img class="aligncenter size-thumbnail wp-image-28706" title="HelloWorldFormclicked" src="http://hackadaycom.files.wordpress.com/2010/09/helloworldformclicked.png?w=96&#038;h=96" alt="" width="96" height="96" /></a></p>
<p>Now that we have completed the next tutorial you should be able to move through the Visual Studio IDE to make multiple projects under one solution, delete files within a project and create new forms and classes, and modify source code within event handlers.  The next tutorial will go more in depth with the Visual Studio Toolbox and make a form with controls on it with minimal backbone code, as well as review some of the common files created and what is automatically included for you.  For more information on Toolbox Controls you can check out <a href="http://bit.ly/ToolboxMSDN">Microsoft MSDN </a>article on Toolbox Controls. If you are having any trouble with this project feel free to comment and I will help to try and resolve the issue.  Until next tutorial, Happy Hacking!</p>
<br />Filed under: <a href='http://hackaday.com/category/news/'>news</a>, <a href='http://hackaday.com/category/software-development/'>Software Development</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/28702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/28702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/28702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/28702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/28702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/28702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/28702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/28702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/28702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/28702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/28702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/28702/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/28702/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/28702/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=28702&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/09/30/c-sharp-development-101-part-1-hello-world/feed/</wfw:commentRss>
		<slash:comments>55</slash:comments>
		<georss:point>43.002684 -81.214990</georss:point>
		<geo:lat>43.002684</geo:lat>
		<geo:long>-81.214990</geo:long>
		<media:content url="" medium="image">
			<media:title type="html">greggers120588</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/09/cworld.jpg" medium="image">
			<media:title type="html">cworld</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/09/visualstudioide.png?w=128" medium="image">
			<media:title type="html">VisualStudioIDE</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/09/helloworldconsole.png?w=128" medium="image">
			<media:title type="html">HelloWorldConsole</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/09/helloworldformunclicked.png?w=96" medium="image">
			<media:title type="html">HelloWorldFormUnclicked</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/09/helloworldformclicked.png?w=96" medium="image">
			<media:title type="html">HelloWorldFormclicked</media:title>
		</media:content>
	</item>
		<item>
		<title>Auxiliary scoreboard reads status directly from memory</title>
		<link>http://hackaday.com/2010/09/13/auxiliary-scoreboard-reads-status-directly-from-memory/</link>
		<comments>http://hackaday.com/2010/09/13/auxiliary-scoreboard-reads-status-directly-from-memory/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 18:00:53 +0000</pubDate>
		<dc:creator>Mike Szczys</dc:creator>
				<category><![CDATA[arduino hacks]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[cheat engine]]></category>
		<category><![CDATA[counter]]></category>
		<category><![CDATA[halo]]></category>
		<category><![CDATA[kill]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[pc]]></category>
		<category><![CDATA[pointer]]></category>

		<guid isPermaLink="false">http://hackaday.com/?p=28175</guid>
		<description><![CDATA[[StaticChanger] built a scoreboard to display his kill statistics from Halo for the PC. Yes, we&#8217;ve seen kill counters before, but we like the way that he gathers the data. This project is reading the score directly from an address in memory. Using a program called Cheat Engine, the memory used by a program can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=28175&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-28176" title="SAMSUNG" src="http://hackadaycom.files.wordpress.com/2010/09/led-kills-meter-e1284396726320.jpg" alt="" width="470" height="353" /></p>
<p>[StaticChanger] <a href="http://staticchanger.com/?p=9">built a scoreboard</a> to display his kill statistics from Halo for the PC. Yes, <a href="http://hackaday.com/2009/12/30/tf2-kill-counter-binary-style/">we&#8217;ve seen kill counters before</a>, but we like the way that he gathers the data. This project is <a href="http://staticchanger.com/?p=22">reading the score directly from an address in memory</a>.</p>
<p>Using a program called <a href="http://www.cheatengine.org/">Cheat Engine</a>, the memory used by a program can be sniffed. After a few passes, the program will help you find a static memory address for your desired data. Once you have that it&#8217;s just a matter of using a pointer to that address in your desired programming language. In this case, a C# program polls the value and instructs an Arduino to display the value on a couple of 7-segment displays. Voila, the number appears next to your screen as you see in the image above.</p>
<br />Filed under: <a href='http://hackaday.com/category/arduino-hacks/'>arduino hacks</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hackadaycom.wordpress.com/28175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hackadaycom.wordpress.com/28175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hackadaycom.wordpress.com/28175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hackadaycom.wordpress.com/28175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hackadaycom.wordpress.com/28175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hackadaycom.wordpress.com/28175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hackadaycom.wordpress.com/28175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hackadaycom.wordpress.com/28175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hackadaycom.wordpress.com/28175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hackadaycom.wordpress.com/28175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hackadaycom.wordpress.com/28175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hackadaycom.wordpress.com/28175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hackadaycom.wordpress.com/28175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hackadaycom.wordpress.com/28175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hackaday.com&amp;blog=4779443&amp;post=28175&amp;subd=hackadaycom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hackaday.com/2010/09/13/auxiliary-scoreboard-reads-status-directly-from-memory/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Mike Szczys</media:title>
		</media:content>

		<media:content url="http://hackadaycom.files.wordpress.com/2010/09/led-kills-meter-e1284396726320.jpg" medium="image">
			<media:title type="html">SAMSUNG</media:title>
		</media:content>
	</item>
	</channel>
</rss>
