<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>quick reference of problems past</title>
	
	<link>http://1024.cjb.net</link>
	<description>boring stuff</description>
	<lastBuildDate>Sat, 25 Feb 2012 22:17:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/qropp" /><feedburner:info uri="qropp" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Canon G3: Remote control and capture with Python</title>
		<link>http://feedproxy.google.com/~r/qropp/~3/a2cVKf6uLd0/</link>
		<comments>http://1024.cjb.net/2012/02/canon-g3-remote-control-and-capture-with-python/#comments</comments>
		<pubDate>Sat, 25 Feb 2012 17:49:07 +0000</pubDate>
		<dc:creator>Kiril</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[canon]]></category>
		<category><![CDATA[gphoto2]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[pyusb]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://1024.cjb.net/?p=116</guid>
		<description><![CDATA[Hello, 2 readers of mine, it&#8217;s been a while. But hey, &#60;brag&#62;I can now take pictures with my old camera being controlled with Python on Linux&#60;/brag&#62;! But why? I want to make a time lapse video of something. I want to take the pictures in the highest quality possible, take thousands of them for weeks [...]]]></description>
			<content:encoded><![CDATA[<p>Hello, 2 readers of mine, it&#8217;s been a while. But hey, &lt;brag&gt;I can now take pictures with my old camera being controlled with Python on Linux&lt;/brag&gt;!</p>
<h3>But why?</h3>
<p>I want to make a time lapse video of something. I want to take the pictures in the highest quality possible, take thousands of them for weeks (or months) and have the camera shoot each one with the exact same settings. The built-in intervalometer of Canon G3 is limited to 100 shots and 5-99 seconds and storage is limited to 256MB of ancient CF. This rules out using it, the project requires USB control and capture. Canon G3 does not support manual focus when remotely controlled, but setting macro mode and locking autofocus would be fine. The only computer I am willing to dedicate for the job is a GuruPlug parked on a shelf under the TV (or maybe the long-awaited RaspberryPi, when it arrives?) The Remote Capture by Canon works and has all the features I need, but it only works on Windows XP and older. Not being able to use Canon&#8217;s Remote Capture, the only <em>somewhat</em> working solution is gphoto2. It, however, cannot set the focus mode to macro, cannot lock the autofocus feature of the camera and needs to expand and contract the lenses for each photo taken. But the proprietary Canon USB protocol was already reverse engineered (THANKS gphoto2 guys!).</p>
<h3>So?</h3>
<p>I set off to write my own USB driver. It is heavily based on gphoto2&#8242;s implementation (though reworked a few times) of the USB protocol, but the goal is to implement all needed features that gphoto2 has, and also throw in:</p>
<ul>
<li>taking multiple shots without exiting remote control mode;</li>
<li>AF locking;</li>
<li>macro mode.</li>
</ul>
<p>A very early, broken, and feature-lacking version can be found at <a href="http://git.hcoop.net/xxcn/canon-remote.git"></a><a href="https://bitbucket.org/xxcn/canon-remote">https://bitbucket.org/xxcn/canon-remote</a>. Work on this has stalled, as I now have a Roomba &#8211; much more fun to play with. I do intend on bringing this to at least a beta stage, but let&#8217;s see if anyone cares at all.</p>
<img src="http://feeds.feedburner.com/~r/qropp/~4/a2cVKf6uLd0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://1024.cjb.net/2012/02/canon-g3-remote-control-and-capture-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://1024.cjb.net/2012/02/canon-g3-remote-control-and-capture-with-python/</feedburner:origLink></item>
		<item>
		<title>Happy Fools’ day</title>
		<link>http://feedproxy.google.com/~r/qropp/~3/9ZILkkfYYOQ/</link>
		<comments>http://1024.cjb.net/2011/04/happy-fools-day/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 08:29:28 +0000</pubDate>
		<dc:creator>Kiril</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://1024.cjb.net/?p=110</guid>
		<description><![CDATA[Having too much spare time at hand, I put together the VK Couples Testing site featured in xkcd&#8216;s Suspicion comic.]]></description>
			<content:encoded><![CDATA[<p>Having too much spare time at hand, I put together the <a title="VK Couples Testing" href="http://vk-couples-testing.appspot.com/">VK Couples Testing</a> site featured in <a href="http://xkcd.com">xkcd</a>&#8216;s <a href="http://xkcd.com/632/">Suspicion</a> comic.</p>
<img src="http://feeds.feedburner.com/~r/qropp/~4/9ZILkkfYYOQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://1024.cjb.net/2011/04/happy-fools-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://1024.cjb.net/2011/04/happy-fools-day/</feedburner:origLink></item>
		<item>
		<title>Yet another DIY Geiger Counter</title>
		<link>http://feedproxy.google.com/~r/qropp/~3/GXZlmp0L30g/</link>
		<comments>http://1024.cjb.net/2010/05/yet-another-diy-geiger-counter/#comments</comments>
		<pubDate>Sun, 02 May 2010 07:51:35 +0000</pubDate>
		<dc:creator>Kiril</dc:creator>
				<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://1024.cjb.net/?p=97</guid>
		<description><![CDATA[After seeing a bunch online I decided I had to make one. Code and schematics are a bit messy, but available on request.]]></description>
			<content:encoded><![CDATA[<p>After seeing a bunch online I decided I had to make one. Code and schematics are a bit messy, but available on request.</p>
<p><a href="http://1024.cjb.net/wp-content/uploads/2010/05/IMG_9262_small.jpg"></a></p>
<div id="attachment_102" class="wp-caption aligncenter" style="width: 610px"><a href="http://1024.cjb.net/wp-content/uploads/2010/05/IMG_9265_small.jpg"><img class="size-full wp-image-102" title="Board in Box" src="http://1024.cjb.net/wp-content/uploads/2010/05/IMG_9265_small.jpg" alt="" width="600" height="450" /></a><p class="wp-caption-text">Board in Box</p></div>
<div id="attachment_100" class="wp-caption aligncenter" style="width: 610px"><a href="http://1024.cjb.net/wp-content/uploads/2010/05/IMG_9262_small.jpg"><img class="size-full wp-image-100" src="http://1024.cjb.net/wp-content/uploads/2010/05/IMG_9262_small.jpg" alt="" width="600" height="450" /></a><p class="wp-caption-text">Board with Probes</p></div>
<p style="text-align: left;">
<div id="attachment_104" class="wp-caption aligncenter" style="width: 330px"><a href="http://1024.cjb.net/wp-content/uploads/2010/05/NewFile0.png"><img class="size-full wp-image-104" src="http://1024.cjb.net/wp-content/uploads/2010/05/NewFile0.png" alt="" width="320" height="234" /></a><p class="wp-caption-text">One count, as seen on my new scope</p></div>
<img src="http://feeds.feedburner.com/~r/qropp/~4/GXZlmp0L30g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://1024.cjb.net/2010/05/yet-another-diy-geiger-counter/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://1024.cjb.net/2010/05/yet-another-diy-geiger-counter/</feedburner:origLink></item>
		<item>
		<title>Graphics for the Nokia 3310 LCD and AVR</title>
		<link>http://feedproxy.google.com/~r/qropp/~3/XDdNYkC5ziI/</link>
		<comments>http://1024.cjb.net/2009/11/graphics-nokia-3310-lcd-avr/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 12:53:40 +0000</pubDate>
		<dc:creator>Kiril</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://lz3060.wordpress.com/?p=38</guid>
		<description><![CDATA[There is a lot of info and code on talking to the Phillips PCD8544 display driver with AVR (and other micros). There is also a guide on hackaday for exporting images for the lcd. And there is this plugin for exporting bitmaps from gimp for another type of display.

I combined ideas and code from the above and came up with a fairly painless procedure for displaying fancy graphics on the teeny tiny but notorious Nokia 3310 display.]]></description>
			<content:encoded><![CDATA[<p>There <a href="http://www.amontec.com/lcd_nokia_3310.shtml">is</a> <a href="http://code.rancidbacon.com/LearningAboutArduinoNokiaLCD">a lot</a> <a href="http://www.myplace.nu/mp3/nokialcd.htm">of</a> <a href="http://www.electronics-lab.com/blog/?p=170">info</a> <a href="http://fandigunawan.wordpress.com/2008/06/18/lcd-nokia-3310-pcd8544-driver-in-winavravr-gcc/">and</a> <a href="http://www.quantumtorque.com/content/view/32/37/">code</a> on talking to the Phillips PCD8544 display driver with AVR (and other micros). There is also <a href="http://hackaday.com/2009/09/29/how-to-generate-font-and-picture-header-files/">a guide</a> on hackaday for exporting images for the lcd. And there is <a href="http://codinglab.blogspot.com/2009/03/gimp-plugin-to-export-bitmaps-for.html">this plugin</a> for exporting bitmaps from gimp for another type of display.</p>
<p>I combined ideas and code from the above and came up with a fairly painless procedure for displaying fancy graphics on the teeny tiny but notorious Nokia 3310 display.</p>
<h3>step I: draw</h3>
<p>Using gimp and your ninja designer skills, draw your icon or graphics. Aim at a final product with height a multiple of 8 and any width (below 84 px). I made a template with the correct settings for the display</p>
<p><strong>Image -&gt; New &#8230;</strong></p>
<p style="text-align: center;"><img class="size-full wp-image-51 aligncenter" title="create_blank" src="http://1024.cjb.net/wp-content/uploads/2009/11/create_blank.png" alt="create_blank" width="390" height="521" /></p>
<p>Note the different X and Y resolutions &#8212; pixels on the display are not square! I measured the physical dimensions myself with a caliper, so the figures may be a little off. The next useful step is to adjust and display a grid</p>
<p><strong>Image -&gt; Configure Grid &#8230;</strong></p>
<p style="text-align: center;"><img class="size-full wp-image-54 aligncenter" title="configure-grid" src="http://1024.cjb.net/wp-content/uploads/2009/11/configure-grid.png" alt="configure-grid" width="390" height="533" /></p>
<p><strong>View -&gt; uncheck &#8220;Dot for dot&#8221; </strong>to enable the custom aspect ratio.</p>
<p style="text-align: left;"><strong>View -&gt; Show Grid</strong> should be obvious.</p>
<p style="text-align: left;">8&#215;6 px is the size of a character on this lcd with the &#8220;standard&#8221; font that you are probably using too. Anyway, width should be whatever floats your boat, but the height of 8 px is extremely helpful. You should be looking at something like this:</p>
<p style="text-align: center;"><img class="size-full wp-image-58 aligncenter" title="lcd-blank" src="http://1024.cjb.net/wp-content/uploads/2009/11/lcd-blank.png" alt="lcd-blank" width="472" height="421" /></p>
<p style="text-align: left;">The above screenshot shows an 8&#215;8 grid with the actual aspect ratio of the display. You should be able to see that those are not squares.</p>
<h3>step II: export</h3>
<p>I based my export plugin on the work of Raul Aguaviva, he wrote an <a href="http://codinglab.blogspot.com/2009/03/gimp-plugin-to-export-bitmaps-for.html">export plugin</a> for ks0108.</p>
<p><a title="The export plugin for Gimp" href="http://1024.cjb.net/files/lcd3310_export.py">Download</a> it, place it in ~/.gimp-2.6/plug-ins/, restart Gimp.</p>
<p>Convert your image to indexed mode, 1-bit palette, remove the alpha chanel (if you have one).</p>
<p><strong>Image -&gt; Export -&gt; AVR 3310&#8230;</strong></p>
<p><img class="aligncenter size-full wp-image-61" title="export-settings" src="http://1024.cjb.net/wp-content/uploads/2009/11/export-settings.png" alt="export-settings" width="456" height="343" /></p>
<p>Click OK. If nothing bursts into flames or frogs don&#8217;t start falling from the sky you should be able to find something similar in the file:</p>
<pre class="c">#ifndef _TEST
#define _TEST

#include &lt;stdint.h&gt;
#include &lt;avr/pgmspace.h&gt;

// Rows: 2 Cols: 12
static const uint8_t icon_bulb[] PROGMEM = {
  /* cols */ 0x0c, /* rows */ 0x02,
  0xf0, 0x18, 0x0c, 0xc4, 0x22, 0xc2, 0x22, 0xc2, 0x24, 0x0c, 0x18, 0xf0,
  0x01, 0x03, 0x06, 0x7c, 0xf8, 0xf8, 0xf8, 0xf8, 0x7c, 0x06, 0x03, 0x01
};
#endif /* _TEST */</pre>
<h3>step III: display</h3>
<p>I render the images with this function</p>
<pre class="c">void display_draw_image_P(const uint8_t * ptr, uint8_t xpos, uint8_t ypos) {
    uint8_t rows, cols, xi, yi;
    cols = pgm_read_byte(ptr);
    rows = pgm_read_byte(ptr+1);
    for (yi=0; yi &lt; rows; yi++) {
        lcd_goto_xy(xpos, ypos+yi);
        for (xi=0; xi &lt; cols; xi++) {
            lcd_data(pgm_read_byte(ptr + 2 + yi*cols + xi));
        }
    }
}</pre>
<p>To use it successfully, replace calls to lcd_goto_xy() and lcd_data() with calls to your driver. That&#8217;s it!</p>
<p>Here&#8217;s another snipped, to show you some actual usage</p>
<pre class="c">static const uint8_t soft_open_normal[] PROGMEM = { 0x00, 0xfe, 0xff };
static const uint8_t soft_open_selected[] PROGMEM = { 0xfe, 0xff, 0xff };
static const uint8_t soft_close_normal[] PROGMEM = { 0xff, 0xfe, 0x00 };
static const uint8_t soft_close_selected[] PROGMEM = { 0xff, 0xff, 0xfe };
/**
 * Returns the width of the softbutton in pixels
 */
int8_t display_draw_softbutton_P(PGM_P label, uint8_t x, uint8_t flags) {
    lcd_goto_xy(x, 5);

    if (flags &amp; DISPLAY_ITEM_SELECTED) {
        lcd_data_arr_P(soft_open_selected, 3);

        char chr;
        while ( (chr = pgm_read_byte(label)) ) {
            lcd_data(0xff);
            for (uint8_t col=0; col &lt; 5; col++) {
                lcd_data( ~pgm_read_byte(FONT_SMALL_CHAR_P(chr) + col) | 0x01);
            }
            label++;
        }

        lcd_data(0xff);
        lcd_data_arr_P(soft_close_selected, 3);

    } else {

// and so on ...</pre>
<p>And here&#8217;s a bad picture of something unfinished</p>
<p><img class="aligncenter size-medium wp-image-81" title="unfinished-screen" src="http://1024.cjb.net/wp-content/uploads/2009/11/unfinished-screen-300x291.png" alt="unfinished-screen" width="300" height="291" /></p>
<img src="http://feeds.feedburner.com/~r/qropp/~4/XDdNYkC5ziI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://1024.cjb.net/2009/11/graphics-nokia-3310-lcd-avr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://1024.cjb.net/2009/11/graphics-nokia-3310-lcd-avr/</feedburner:origLink></item>
		<item>
		<title>RH measurement with resistive sensor and AVR</title>
		<link>http://feedproxy.google.com/~r/qropp/~3/Qo-SZrtifMU/</link>
		<comments>http://1024.cjb.net/2009/10/rh-measurement-resistive-avr/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 23:21:08 +0000</pubDate>
		<dc:creator>Kiril</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[rh measurement]]></category>

		<guid isPermaLink="false">http://lz3060.wordpress.com/?p=12</guid>
		<description><![CDATA[Needing to measure relative humidity, I went to a local electronic components store and asked for a sensor. All they had was the H25K5A (datasheet). As it turns out, this is the cheapest type of relative humidity sensor, and a real pain to read with a microcontroller. Well, not really that hard, but there is [...]]]></description>
			<content:encoded><![CDATA[<p>Needing to measure relative humidity, I went to a local electronic components store and asked for a sensor. All they had was the H25K5A (<a title="H25K5A" href="http://www.sensorelement.com/humidity/H25K5A%20spec.pdf" target="_blank">datasheet</a>). As it turns out, this is the cheapest type of relative humidity sensor, and a real pain to read with a microcontroller. Well, not really that hard, but there is not much info on the web and it took a while to figure out. I am going to outline my method and proceedings below with the hope that some lost soul will someday find this work and thank me in their mind.</p>
<p>The first thing there is to know about resistive humidity sensors is they don&#8217;t like DC. Any DC current passing through them will cause irreversible damage to the sensor because of electrolysis going on inside its sensitive guts. AC only please, no DC bias whatsoever! The second thing is it has a significant amount of stray capacitance which needs to be taken into account, but its actual value is not mentioned anywhere in the datasheet. Thank you, China and company, for your high standards.</p>
<p>After a couple of days of Google searches, I found <a href="http://www.apollounion.com/down.asp?filename=Upload/DownFiles/200965858493943.pdf" target="_blank">this</a> gem. It is written in very poor English, it misses out on quite a few details &#8230; generally sounds like bullshit. But the procedure described in it actually works! The really cool thing about it is that no external components are required, except for a resistor. It takes 2 IO pins of the mcu and an ADC input:</p>
<div id="attachment_15" class="wp-caption alignnone" style="width: 439px"><img class="size-full wp-image-15" title="Basic RH measurement circuit" src="http://lz3060.files.wordpress.com/2009/10/rh_basics.png" alt="Basic RH measurement circuit" width="429" height="262" /><p class="wp-caption-text">Basic RH measurement circuit</p></div>
<p>The IO pins alternate their levels during measurement. After each transition, it takes some time (on the order of μs) for the voltage to stabilize &#8212; that&#8217;s when ADC reading must be fired. Measurements can be taken in only one state, or in both states of the IO pins. So I decided to measure both V<sub>1</sub> and V<sub>2</sub>:</p>
<div id="attachment_16" class="wp-caption alignnone" style="width: 460px"><img class="size-full wp-image-16" title="IO and ADC voltages" src="http://lz3060.files.wordpress.com/2009/10/rh_io_levels.png" alt="IO and ADC voltages" width="450" height="192" /><p class="wp-caption-text">IO and ADC voltages</p></div>
<p>Resistance of the sensor &#8212; R(rh) &#8212; can be calculated from the  ADC readings, granted V<sub>cc</sub> = V<sub>ref</sub>, where V<sub>ref</sub> is the reference voltage for ADC:</p>
<pre>R(rh) = (Vcc x R1)/V1 - R1
R(rh) = (V2 x R1)/(Vcc - V2)</pre>
<p>Actually, that second equation will fail at V<sub>2</sub> = 0, but it&#8217;s also true that Vcc = V1 + V2. So, take a bunch of readings for both states, average each out, then have</p>
<p>V<sub>1,average</sub> = (V<sub>1</sub> + (V<sub>cc</sub> &#8211; V<sub>2</sub>)) / 2</p>
<p>This approach gives the maximum number of ADC readings for the time current passes through the sensor. Did I mention that even with pure AC these sensors eventually give up? People say that you should pass the least possible amount of current though them.</p>
<p>At this point I built a prototype and it worked! The sum of averaged ADC reads for the 2 IO states was 1023±3 (10-bit ADC) &#8212; fair enough. The numbers reacted pretty well to me breathing into the sensor too. Now, how do I get from a number between 3 and 1020 to an actual figure for relative humidity in percent? Pretty simple &#8212; just take the calibration data from the datasheet, reformat it into data points, go to <a href="http://zunzun.com/" target="_blank">zunzun.com</a> and stare in dismay. That website blew my mind, but more on it later.</p>
<p>First, let&#8217;s take a look at the correlation between ADC values and R(rh):</p>
<div id="attachment_26" class="wp-caption alignnone" style="width: 460px"><img class="size-full wp-image-26" title="ADC vs R(rh)" src="http://lz3060.files.wordpress.com/2009/10/untitled-12.png" alt="ADC vs. R(rh) value for different values of R1" width="450" height="305" /><p class="wp-caption-text">ADC vs. R(rh) value for different values of R1</p></div>
<p>The dynamic range of my sensor is from around 2KOhm to about 21MOhm. That&#8217;s quite some range! Using a simple voltage divider will obviously not yield good results in terms of accuracy, but especially in terms of resolution at the far ends of the range &#8212; whichever one line on the graph I pick, there will be regions where my device will interpret a single least-significant bit change as a huge difference in relative humidity. To solve this, I do not use one voltage divider, but 3. Actually, more can be added, I just like the number 3:</p>
<p><img class="alignnone size-full wp-image-29" title="Improved RH measurement circuit" src="http://lz3060.files.wordpress.com/2009/10/rh_improved.png" alt="Improved RH measurement circuit" width="447" height="423" /></p>
<p>This allows good dynamic range to be achieved by using either one of IO2, IO3 and IO4 for the opposite end of the voltage divider. So I find the derivatives of the above plots, find the points where they intersect and define the interval in which each curve is optimal.</p>
<pre>ADC value expressed as function of R(rh)
ADC(R(rh)) = 1023 * R1 / (R(rh) + R1)

First Derivative
ADC'(R(rh)) = 1023 * R1 / (R(rh) + R1)^2

Find points where derivatives intersect

Solve ADC(R1=3)'(R(rh)) = ADC(R1=30)'(R(rh)) -&gt; R(rh) = 3 * sqrt(10)
Solve ADC(R1=30)'(R(rh)) = ADC(R1=300)'(R(rh)) -&gt; R(rh) = 30 * sqrt(10)</pre>
<p>Therefore, resistances below ~9.48 KOhm should be measured with the 3KOhm bridge, such above 94.8KOhm should be measured with the 300KOhm bridge, everything else falls in the middle.</p>
<p>The next step is to get that value and turn it into RH%. Did I mention the sensor is heavily temperature-dependent? I should have, but you should have known if you looked at the datasheet. Adding a thermometer to an AVR-based device is fairly simple, I&#8217;ll just outline what I did next:</p>
<p>Pasted the reference values table from the datasheet into a spreadsheet, aligned it, transformed it into one-data-point-per-row format, copy/paste into <a title="Zun Zun is THE BEST" href="http://zunzun.com/FunctionFinder/3/">zunzun.com&#8217;s 3D Function Finder</a>. After it was done I had a piece of code I could readily paste into my program. Cool. The only problem is that the best interpolation gives ±15% error, and that is a lot. My plan is to slice the data into 3 temperature regions (or maybe slice it by resistance) and see if individual interpolations for each will yield better results.</p>
<p>This is a work in progress, part of a project I intend to release as open hardware. There&#8217;s a lot more to be done though, so stay tuned if you are interested. As always, comments are welcome, except in Russian.</p>
<p><strong>Update:</strong> making some progress on the project, current code can be seen <a title="Source Code" href="http://github.com/kikcho/gbb/tree/master/src/">here</a>, rendered schematics and links are also <a title="Project Home" href="http://growboxbox.org/">available</a>.</p>
<img src="http://feeds.feedburner.com/~r/qropp/~4/Qo-SZrtifMU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://1024.cjb.net/2009/10/rh-measurement-resistive-avr/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://1024.cjb.net/2009/10/rh-measurement-resistive-avr/</feedburner:origLink></item>
		<item>
		<title>First attempt at an Eclipse-compatible, flexible Arduino AVR Makefile</title>
		<link>http://feedproxy.google.com/~r/qropp/~3/j7n8zi_Aino/</link>
		<comments>http://1024.cjb.net/2009/05/avr-makefile-first-attempt/#comments</comments>
		<pubDate>Thu, 21 May 2009 20:09:44 +0000</pubDate>
		<dc:creator>Kiril</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[avr-gcc]]></category>

		<guid isPermaLink="false">http://lz3060.wordpress.com/?p=3</guid>
		<description><![CDATA[I&#8217;ve been playing with an Arduino board for a couple of months now (mostly during the weekends). Arduino is a great device &#8212; especially because it&#8217;s so simple to work with, both in terms of software and hardware. However, being a programmer, I felt sick about having to use the Arduino IDE. I&#8217;m using Eclipse [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing with an Arduino board for a couple of months now (mostly during the weekends). Arduino is a great device &#8212; especially because it&#8217;s so simple to work with, both in terms of software and hardware. However, being a programmer, I felt sick about having to use the Arduino IDE. I&#8217;m using Eclipse in my dayjob, and though I don&#8217;t depend on it, I sure appreciate the time and effort a <strong>true</strong> IDE saves.</p>
<p>I was playing with an ATtiny26L a year or two ago, and even back then I was using Eclipse. There was no avr plugin, but still, configuring a C/C++ project was worth it. Now, that I had an Arduino board I wanted to use the core libraries for it inside Eclipse. The <a href="http://www.arduino.cc/playground/Code/Eclipse">Eclipse tutorial</a> did work at first, but broke badly with 0015. Additionally, the method described there did not allow for modifications of the libraries, which sometimes <a href="http://mekonik.wordpress.com/2009/03/02/modified-arduino-library-serial/">proves necessary</a>.</p>
<p>So, I came up with my own method. Here&#8217;s a very summarized howto:</p>
<ul>
<li>Install Eclipse, the AVR plugin for Eclipse, and make sure you have gcc-avr, avr-libc and all the necessary tools to build code for the AVR target.</li>
<li>In Eclipse, create a new C++ project using the &#8220;AVR Cross-target application&#8221; template.</li>
<li>Copy the <code>hardware/cores/arduino</code> directory from your Arduino IDE inside your newly created C++ project. Then go to the project properties -&gt; AVR and configure your Target and Programmer.</li>
<li>In the project properties dialog, click on C/C++ Build and uncheck &#8220;Generate Makefiles automatically&#8221;</li>
<li>In the Build directory field, enter <code>${workspace_loc:/YourProjectName/build}</code> Replace YourProjectName with the actual name of the project <img src='http://1024.cjb.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Create the build directory inside your project, create a Makefile inside it, and paste the following:</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="make" style="font-family:monospace;"><span style="color: #339900; font-style: italic;"># Makefile for building small AVR executables, supports C and C++ code</span>
<span style="color: #339900; font-style: italic;"># Author: Kiril Zyapkov</span>
&nbsp;
SOURCE_DIRS <span style="color: #004400;">=</span> <span style="color: #004400;">.</span> arduino
INCLUDE_DIRS <span style="color: #004400;">=</span> arduino
MMCU <span style="color: #004400;">=</span> atmega168
F_CPU <span style="color: #004400;">=</span> 16000000UL
SRC_ROOT <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CURDIR</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/..</span>
BUILD_DIR <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CURDIR</span><span style="color: #004400;">&#41;</span>
&nbsp;
CFLAGS <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>Wall <span style="color: #004400;">-</span>g2 <span style="color: #004400;">-</span>gstabs <span style="color: #004400;">-</span>Os <span style="color: #004400;">-</span>fpack<span style="color: #004400;">-</span>struct <span style="color: #004400;">-</span>fshort<span style="color: #004400;">-</span>enums <span style="color: #004400;">-</span>ffunction<span style="color: #004400;">-</span>sections \
 <span style="color: #004400;">-</span>fdata<span style="color: #004400;">-</span>sections <span style="color: #004400;">-</span>ffreestanding <span style="color: #004400;">-</span>funsigned<span style="color: #004400;">-</span>char <span style="color: #004400;">-</span>funsigned<span style="color: #004400;">-</span>bitfields \
 <span style="color: #004400;">-</span>mmcu<span style="color: #004400;">=$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MMCU</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>DF_CPU<span style="color: #004400;">=$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">F_CPU</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span>INCLUDE_DIRS<span style="color: #004400;">:%=-</span>I<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SRC_ROOT</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%</span><span style="color: #004400;">&#41;</span>
&nbsp;
CXXFLAGS <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>Wall <span style="color: #004400;">-</span>g2 <span style="color: #004400;">-</span>gstabs <span style="color: #004400;">-</span>Os <span style="color: #004400;">-</span>fpack<span style="color: #004400;">-</span>struct <span style="color: #004400;">-</span>fshort<span style="color: #004400;">-</span>enums <span style="color: #004400;">-</span>ffunction<span style="color: #004400;">-</span>sections \
 <span style="color: #004400;">-</span>fdata<span style="color: #004400;">-</span>sections <span style="color: #004400;">-</span>ffreestanding <span style="color: #004400;">-</span>funsigned<span style="color: #004400;">-</span>char <span style="color: #004400;">-</span>funsigned<span style="color: #004400;">-</span>bitfields \
 <span style="color: #004400;">-</span>fno<span style="color: #004400;">-</span>exceptions <span style="color: #004400;">-</span>mmcu<span style="color: #004400;">=$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MMCU</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>DF_CPU<span style="color: #004400;">=$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">F_CPU</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span>INCLUDE_DIRS<span style="color: #004400;">:%=-</span>I<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SRC_ROOT</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%</span><span style="color: #004400;">&#41;</span>
&nbsp;
LDFLAGS <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>Os <span style="color: #004400;">-</span>Wl<span style="color: #004400;">,-</span>gc<span style="color: #004400;">-</span>sections <span style="color: #004400;">-</span>mmcu<span style="color: #004400;">=$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MMCU</span><span style="color: #004400;">&#41;</span> <span style="color: #339900; font-style: italic;">#-Wl,--relax</span>
&nbsp;
TARGET <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #0000CC; font-weight: bold;">notdir</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">realpath</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SRC_ROOT</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">&#41;</span>
CC <span style="color: #004400;">=</span> avr<span style="color: #004400;">-</span>gcc
CXX <span style="color: #004400;">=</span> avr<span style="color: #004400;">-</span>g<span style="color: #004400;">++</span>
OBJCOPY <span style="color: #004400;">=</span> avr<span style="color: #004400;">-</span>objcopy
OBJDUMP <span style="color: #004400;">=</span> avr<span style="color: #004400;">-</span>objdump
AR  <span style="color: #004400;">=</span> avr<span style="color: #004400;">-</span>ar
SIZE <span style="color: #004400;">=</span> avr<span style="color: #004400;">-</span>size
&nbsp;
SRC <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #0000CC; font-weight: bold;">wildcard</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span>SOURCE_DIRS<span style="color: #004400;">:%=$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SRC_ROOT</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%/*.</span>c<span style="color: #004400;">&#41;</span><span style="color: #004400;">&#41;</span>
&nbsp;
CXXSRC <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #0000CC; font-weight: bold;">wildcard</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span>SOURCE_DIRS<span style="color: #004400;">:%=$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SRC_ROOT</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%/*.</span>cpp<span style="color: #004400;">&#41;</span><span style="color: #004400;">&#41;</span>
&nbsp;
OBJ <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span>SRC<span style="color: #004400;">:$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SRC_ROOT</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%.</span>c<span style="color: #004400;">=$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">BUILD_DIR</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%.</span>o<span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span>CXXSRC<span style="color: #004400;">:$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SRC_ROOT</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%.</span>cpp<span style="color: #004400;">=$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">BUILD_DIR</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%.</span>o<span style="color: #004400;">&#41;</span>
&nbsp;
DEPS <span style="color: #004400;">=</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span>OBJ<span style="color: #004400;">:%.</span>o<span style="color: #004400;">=%.</span>d<span style="color: #004400;">&#41;</span>
&nbsp;
<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">BUILD_DIR</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%.</span>o<span style="color: #004400;">:</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SRC_ROOT</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%.</span>c
	<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CC</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CFLAGS</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>c <span style="color: #000088; font-weight: bold;">$&amp;</span>lt<span style="color: #004400;">;</span> <span style="color: #004400;">-</span>o <span style="color: #000088; font-weight: bold;">$@</span>
&nbsp;
<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">BUILD_DIR</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%.</span>o<span style="color: #004400;">:</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SRC_ROOT</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%.</span>cpp
	<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CXX</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CXXFLAGS</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>c <span style="color: #000088; font-weight: bold;">$&amp;</span>lt<span style="color: #004400;">;</span> <span style="color: #004400;">-</span>o <span style="color: #000088; font-weight: bold;">$@</span>
&nbsp;
<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TARGET</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>a<span style="color: #004400;">:</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">OBJ</span><span style="color: #004400;">&#41;</span>
	<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">AR</span><span style="color: #004400;">&#41;</span> rcs <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TARGET</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>a <span style="color: #000088; font-weight: bold;">$?</span>
&nbsp;
<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">BUILD_DIR</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%.</span>d<span style="color: #004400;">:</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SRC_ROOT</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%.</span>c
	mkdir <span style="color: #004400;">-</span>p <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #0000CC; font-weight: bold;">dir</span> <span style="color: #000088; font-weight: bold;">$@</span><span style="color: #004400;">&#41;</span>
	<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CC</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CFLAGS</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>MM <span style="color: #004400;">-</span>MF <span style="color: #000088; font-weight: bold;">$@</span> <span style="color: #000088; font-weight: bold;">$&amp;</span>lt<span style="color: #004400;">;</span>
&nbsp;
<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">BUILD_DIR</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%.</span>d<span style="color: #004400;">:</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">SRC_ROOT</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">/%.</span>cpp
	mkdir <span style="color: #004400;">-</span>p <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #0000CC; font-weight: bold;">dir</span> <span style="color: #000088; font-weight: bold;">$@</span><span style="color: #004400;">&#41;</span>
	<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CXX</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CXXFLAGS</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>MM <span style="color: #004400;">-</span>MF <span style="color: #000088; font-weight: bold;">$@</span> <span style="color: #000088; font-weight: bold;">$&amp;</span>lt<span style="color: #004400;">;</span>
&nbsp;
<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TARGET</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>elf<span style="color: #004400;">:</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TARGET</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>a
	<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">CXX</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">LDFLAGS</span><span style="color: #004400;">&#41;</span> <span style="color: #000088; font-weight: bold;">$&amp;</span>lt<span style="color: #004400;">;</span> <span style="color: #004400;">-</span>o <span style="color: #000088; font-weight: bold;">$@</span>
&nbsp;
<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TARGET</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>hex<span style="color: #004400;">:</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TARGET</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>elf
	<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">OBJCOPY</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">-</span>R <span style="color: #004400;">.</span>eeprom <span style="color: #004400;">-</span>O ihex <span style="color: #000088; font-weight: bold;">$&amp;</span>lt<span style="color: #004400;">;</span>  <span style="color: #000088; font-weight: bold;">$@</span>
&nbsp;
all<span style="color: #004400;">:</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TARGET</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>hex printsize
&nbsp;
clean<span style="color: #004400;">:</span>
	<span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">RM</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">DEPS</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">OBJ</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TARGET</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.*</span>
&nbsp;
printsize<span style="color: #004400;">:</span>
	avr<span style="color: #004400;">-</span>size <span style="color: #004400;">--</span>format<span style="color: #004400;">=</span>avr <span style="color: #004400;">--</span>mcu<span style="color: #004400;">=$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">MMCU</span><span style="color: #004400;">&#41;</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">TARGET</span><span style="color: #004400;">&#41;</span><span style="color: #004400;">.</span>elf
&nbsp;
<span style="color: #990000;">.PHONY</span><span style="color: #004400;">:</span> all clean printsize
&nbsp;
<span style="color: #339900; font-style: italic;">#include automatically generated dependencies</span>
<span style="color: #004400;">-</span><span style="color: #666622; font-weight: bold;">include</span> <span style="color: #004400;">$</span><span style="color: #004400;">&#40;</span><span style="color: #000088;">DEPS</span><span style="color: #004400;">&#41;</span></pre></div></div>

<p>This is my first Makefile, so it&#8217;s probably stupid, ineffective, buggy and cryptic. Feel free to let me know <img src='http://1024.cjb.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I did not use the one that comes with the core libraries since I could not understand it all, plus it does stuff I don&#8217;t need (pre-processing to make an &#8216;Arduino language&#8217; sketch into legal C/C++ for instance).</p>
<p>Here&#8217;s a blank sketch that you can try compiling:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &quot;WProgram.h&quot;</span>
<span style="color: #0000ff;">void</span> setup<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">void</span> loop<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #666666;">// implement void(), setup() and any other functions below</span>
&nbsp;
<span style="color: #666666;">// the 'standard' main function for Arduino</span>
<span style="color: #0000ff;">void</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> __attribute__ <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span>noreturn<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">void</span> main<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
    init<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    setup<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #008080;">;;</span><span style="color: #008000;">&#41;</span>
        loop<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Place the above in a .cpp file in the project and click the &#8220;Build&#8221; button. If you configured the programmer details, uploading should work as well.</p>
<img src="http://feeds.feedburner.com/~r/qropp/~4/j7n8zi_Aino" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://1024.cjb.net/2009/05/avr-makefile-first-attempt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://1024.cjb.net/2009/05/avr-makefile-first-attempt/</feedburner:origLink></item>
	</channel>
</rss>

