<?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/"
	>

<channel>
	<title>/tmp/santos &#187; ubuntu</title>
	<atom:link href="http://www.tmpsantos.com.br/tag/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tmpsantos.com.br</link>
	<description>Thiago Marcos P. Santos</description>
	<lastBuildDate>Tue, 07 Feb 2012 14:33:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Arduino Uno + Ubuntu + CMake</title>
		<link>http://www.tmpsantos.com.br/en/2010/12/arduino-uno-ubuntu-cmake/</link>
		<comments>http://www.tmpsantos.com.br/en/2010/12/arduino-uno-ubuntu-cmake/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 12:26:12 +0000</pubDate>
		<dc:creator>Thiago</dc:creator>
				<category><![CDATA[devel]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerd]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[buildsystem]]></category>
		<category><![CDATA[cmake]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.tmpsantos.com.br/?p=728</guid>
		<description><![CDATA[I&#8217;ve been playing with my brand new Arduino Uno since the beginning of this week on my Linux box. Unfortunately the Maverick (10.10) release of Ubuntu ships a version of Arduino SDK that is incompatible with Uno, looks like the package version was frozen days before the release of Uno hardware. So, the first thing [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing with my brand new Arduino Uno since the beginning of  this week on my Linux box. Unfortunately the Maverick (10.10) release of Ubuntu ships a version of  Arduino SDK that is <a href="https://bugs.launchpad.net/maverick-backports/+bug/666849">incompatible</a> with Uno, looks like the package version was frozen days before the release of Uno hardware. So, the first thing I had to do was update the SDK using <span style="text-decoration: line-through">unstable</span> packages from Natty (11.04). Just download and  manually upgrade the from the <a href="http://packages.ubunut.com/search?keywords=arduino&amp;searchon=names&amp;suite=natty&amp;section=all">Ubuntu website</a> (remember to upgrade both <strong>arduino</strong> and <strong>arduino-core</strong>).</p>
<p><a href="http://www.tmpsantos.com.br/wp-content/uploads/2010/12/arduino.jpeg"><img class="size-full wp-image-734 aligncenter" src="http://www.tmpsantos.com.br/wp-content/uploads/2010/12/arduino.jpeg" alt="" width="225" height="225" /></a>The IDE is very user friendly to casual developers and allows to write simple programs without much effort. At the first glance might look like a non-standard C/C++, although the IDE magically adds some include headers and a simple main() calling your setup() and loop() routine when you click on the <strong>Upload</strong> button. Looks like there is no way to use multiples files in your project, which is OK for small sketches.</p>
<p style="text-align: left"><a href="http://www.tmpsantos.com.br/wp-content/uploads/2010/12/arduino_ide.png"><img class="aligncenter size-medium wp-image-737" style="border: 10px solid white" src="http://www.tmpsantos.com.br/wp-content/uploads/2010/12/arduino_ide-246x300.png" alt="Arduino IDE" width="246" height="300" /></a></p>
<p style="text-align: left">For those who want to develop things in the traditional way using the command line, I started a <a href="http://www.cmake.org/">CMake</a> template for Arduino Uno. The template was written in a such way that makes possible to add support for new devices by just creating a new device profile file. There is no restrictions of using this template on other Linux distributions (or even other OS, since CMake runs on Mac and Windows), but adaptations might be needed. Patches are always welcome. <img src='http://www.tmpsantos.com.br/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2 style="text-align: left">Using the Arduino CMake template</h2>
<p style="text-align: left">As pre-condition, you will need <strong>cmake</strong> package (duh!) and a compatible version of Arduino SDK (see Ubuntu Maverick x Uno issue above and how to fix). Only the <strong>arduino-core</strong> package is necessary for this setup.</p>
<p style="text-align: left">Download the latest version of the buildsystem template:</p>
<p style="text-align: left"><a href="http://www.tmpsantos.com.br/cgi-bin/gitweb.cgi?p=arduino_cmake.git;a=snapshot;h=HEAD;sf=tgz">arduino_cmake.tar.gz</a></p>
<p style="text-align: left">This is a modified version of the classic <a href="http://www.arduino.cc/en/Tutorial/Blink">Blink example</a>, converted to a standard C/C++ (it&#8217;s really weird why the Arduino libraries are a mixture of C and C++ and not only C). This example is great because gives you visual feedback without attaching any component to the board, since there is a built-in LED on the board tied to pin 13. Because cmake it&#8217;s not a widely spread buildsystem (which is a shame for such a great tool), here are some basic instructions of how to build the project. Type this from the root of your project tree:</p>
<pre>$ mkdir build
$ cd build
$ cmake ..
$ make</pre>
<p style="text-align: left">You can either export the environment variable ARDUINO_PORT set to your device port or edit CMakeLists.txt and change the default value permanently. Mostly likely you don&#8217;t need to touch this if you are using Ubuntu Maverick and Arduino Uno combo.</p>
<p style="text-align: left">Two extra targets were added to the generated Makefile for your convenience:</p>
<ul>
<li><strong>make flash</strong> &#8211; Will flash your software to the device connected on ARDUINO_PORT.</li>
<li><strong>make reset</strong> &#8211; Restart your board (pretty much the same as the reset button on the board).</li>
</ul>
<h2>Bonus tip<strong> </strong></h2>
<p>My favorite debugging tool is printf(). The modified version of the Blink application in the template also contains some debug output. Use <strong>minicom</strong> to read the output from the terminal:</p>
<pre>$ minicom -b 115200 -D /dev/ttyACM0</pre>
<p>You need to exit from minicom before flash your device again. Do that by hitting CTRL+A and then X.</p>
<h2>Disclaimer<strong> </strong></h2>
<p>Of course that by following this tutorial and using my buildsystem template you can turn your device in a useless geek-looking paperweight. Use at your own risk.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tmpsantos.com.br/en/2010/12/arduino-uno-ubuntu-cmake/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

