<?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>Meltingshell's Blog</title>
	<atom:link href="http://meltingshell.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://meltingshell.wordpress.com</link>
	<description>Un blog dedicato a linux Ubuntu</description>
	<lastBuildDate>Thu, 19 Mar 2009 18:03:40 +0000</lastBuildDate>
	<language>it</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='meltingshell.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Meltingshell's Blog</title>
		<link>http://meltingshell.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://meltingshell.wordpress.com/osd.xml" title="Meltingshell&#039;s Blog" />
	<atom:link rel='hub' href='http://meltingshell.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Programmare l&#8217;RCX lego con ubuntu</title>
		<link>http://meltingshell.wordpress.com/2008/11/23/programmare-lrcx-lego-con-ubuntu/</link>
		<comments>http://meltingshell.wordpress.com/2008/11/23/programmare-lrcx-lego-con-ubuntu/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 14:38:03 +0000</pubDate>
		<dc:creator>meltingshell</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bricxcc]]></category>
		<category><![CDATA[Lego]]></category>
		<category><![CDATA[nqc]]></category>
		<category><![CDATA[rcx]]></category>

		<guid isPermaLink="false">http://meltingshell.wordpress.com/?p=3</guid>
		<description><![CDATA[Come primo articolo spiegerò brevemente come installare tutto il necessario per poter utilizzare l&#8217;RCX lego su ubuntu. L&#8217;articolo originale lo trovate qui. I quattro passi fondamentali sono: Installazione della torretta usb a raggi infrarossi Installazione e configurazione del compilatore nqc Editor del codice utilizzabili Scaricamento firmware 1. USB tower a raggi infrarossi Per prima cosa [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltingshell.wordpress.com&amp;blog=5618699&amp;post=3&amp;subd=meltingshell&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Come primo articolo spiegerò brevemente come installare tutto il necessario per poter utilizzare l&#8217;RCX lego su ubuntu.</p>
<p>L&#8217;articolo originale lo trovate <a href="http://trevorcreech.com/blog/2007/07/15/lego-robotics-invention-system-on-ubuntu-linux/">qui</a>.</p>
<p>I quattro passi fondamentali sono:</p>
<ol>
<li>Installazione della torretta usb a raggi infrarossi</li>
<li>Installazione e configurazione del compilatore nqc</li>
<li>Editor del codice utilizzabili</li>
<li>Scaricamento firmware</li>
</ol>
<h1>1. USB tower a raggi infrarossi</h1>
<p>Per prima cosa collegare la torretta al pc tramite una porta USB.</p>
<p>Aprire il file di configurazione come admin con:</p>
<blockquote><p>sudo gedit /etc/udev/legoTower.conf</p></blockquote>
<p>e incollarci all&#8217;interno questo testo:</p>
<blockquote><p>#!/bin/bash<br />
ln -s /dev/usb/legousbtower0 /dev/usb/lego0<br />
chmod 666 /dev/usb/lego0</p></blockquote>
<p>quindi chiudere il file e salvare.</p>
<p>Aprire il file di configurazione come admin con:</p>
<blockquote><p>sudo gedit /etc/udev/rules.d/91-legotower.rules</p></blockquote>
<p>e incollarci dentro questo testo:</p>
<blockquote><p>ACTION==&#8221;add&#8221;, SUBSYSTEM==&#8221;usb&#8221;, ATTRS{product}==&#8221;LEGO USB Tower&#8221;, ATTRS{manufacturer}==&#8221;LEGO Group&#8221;, RUN+=&#8221;/etc/udev/legoTower.conf&#8221;</p></blockquote>
<p>quindi chiudere e salvare.</p>
<p>In questo modo ogni volta che verrà collegata la torretta questa sarà subito disponibile.</p>
<p>Per testare la torretta scollegarla e ricollegarla, quindi digitare il comando:</p>
<blockquote><p>echo test &gt; /dev/usb/lego0</p></blockquote>
<p>Se tutto è andato bene dovrebbe accedersi un led verde all&#8217;interno della torretta.</p>
<h1>2. Compilatore NQC</h1>
<h3>1. Installazione da repository</h3>
<p>Nqc è disponibile nei repository ufficiali ubuntu, potete installarlo digitando:</p>
<blockquote><p>sudo apt-get install nqc</p></blockquote>
<h3>2. Installazione da sorgenti</h3>
<p>Il compilatore NQC (Not Quite C) servirà per compilare i programmi scritti e scaricarli sull&#8217;RCX.</p>
<p>Per prima cosa bisogna scaricare l&#8217;ultima versione del codice sorgente di nqc da <a href="http://bricxcc.sourceforge.net/nqc/release/index.html">qui</a>.</p>
<p>Una volta scaricato ed estratto spostarsi nella cartella e digitare il comando:</p>
<blockquote><p>gedit Makefile</p></blockquote>
<p>All&#8217;interno del file è necessario cercare la riga:</p>
<blockquote><p>#  USBOBJ = rcxlib/RCX_USBTowerPipe_linux.o</p></blockquote>
<p>e togliere il commento cioè il cancelletto davanti:</p>
<blockquote><p>USBOBJ = rcxlib/RCX_USBTowerPipe_linux.o</p></blockquote>
<p>quindi salvare il file e chiuderlo.</p>
<p>Ora creare la cartella rcxlib/LegoUSB:</p>
<blockquote><p>mkdir rcxlib/LegoUSB</p></blockquote>
<p>e copiarci all&#8217;interno il driver per la torretta:</p>
<blockquote><p>cd rcxlib/LegoUSB</p>
<p>wget http://legousb.cvs.sourceforge.net/*checkout*/legousb/LegoUSB/drivers/linux/include/legousbtower.h rcxlib/LegoUSB/legousbtower.h</p>
<p>cd ../../</p></blockquote>
<p>E quindi compilare ed installare il compilatore:</p>
<blockquote><p>make</p>
<p>sudo make install</p>
<p>echo export RCX_PORT=usb &gt;&gt; ~/.bashrc</p></blockquote>
<p>Anche questa volta per controllare che nqc utilizzi correttamente la torretta digitare il comando</p>
<blockquote><p>nqc -msg 7</p></blockquote>
<p>Se tutto è andato bene come prima dovrebbe accedersi un led verde nella torretta.</p>
<h1>3. Editor del codice</h1>
<p>Su windows è presente un ottimo editor chiamato <a title="Bricxcc Site" href="http://bricxcc.sourceforge.net/">Bricx Command Center</a> che purtroppo non è disponibile per linux. Si può comunque ulilizzare attraverso wine anche se non è possibile collegarlo alla torretta IR.</p>
<p>E&#8217; comunque possibile utilizzare tutti gli altri editor C, ad esempio gedit, compilarli e scaricarli sull&#8217;RCX con il compilatore nqc.</p>
<h1>4. Scaricamento firmware</h1>
<p>L&#8217;ultima cosa da fare è scaricare il firmware sull&#8217;RCX.</p>
<p>Inserire il cd-rom Robotics Invention System ed eseguire questo comando per scaricarlo sull&#8217;RCX:</p>
<blockquote><p>nqc -firmware /media/cdrom/firm/firm0309.lgo</p></blockquote>
<p>Ora abbiamo tutto quello che ci serve per poter cominciare a programmare i nostri robottini lego con ubuntu.</p>
<p>Buon divertimento</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meltingshell.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meltingshell.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/meltingshell.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/meltingshell.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/meltingshell.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/meltingshell.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/meltingshell.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/meltingshell.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/meltingshell.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/meltingshell.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/meltingshell.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/meltingshell.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/meltingshell.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/meltingshell.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltingshell.wordpress.com&amp;blog=5618699&amp;post=3&amp;subd=meltingshell&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meltingshell.wordpress.com/2008/11/23/programmare-lrcx-lego-con-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d8b3ed5d06736f01af8cc70e3159abee?s=96&#38;d=identicon" medium="image">
			<media:title type="html">meltingshell</media:title>
		</media:content>
	</item>
	</channel>
</rss>
