<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>degrunt.org: Category nxt</title>
    <link>http://www.degrunt.org/articles/category/nxt</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>lego, mindstorms, technics, pneumatic</description>
    <item>
      <title>XPM / XPiXMap and pbLua / NXT</title>
      <description>&lt;p&gt;Well, while I was at it tonight, I found that the text-based interface of pbLua isn&amp;#8217;t very user friendly in comparison to the default &lt;span class="caps"&gt;LEGO NXT&lt;/span&gt; interface with it&amp;#8217;s nice icons. Not that we need icons of course, but they&amp;#8217;re cool. ;)&lt;/p&gt;


	&lt;p&gt;So I wrote a Lua class which can open &lt;a href="http://en.wikipedia.org/wiki/X_PixMap"&gt;&lt;span class="caps"&gt;XPM&lt;/span&gt;&lt;/a&gt; images, which are stored on the FileSystem and show them anywhere on the &lt;span class="caps"&gt;NXT&lt;/span&gt;-screen.&lt;/p&gt;


&lt;span class="caps"&gt;XPM&lt;/span&gt; images are also textbased, very ideal for our purpose, albeit they don&amp;#8217;t have a very small footprint (the below image is 160 bytes, so it&amp;#8217;s also not &lt;span class="caps"&gt;TOO&lt;/span&gt; big):
&lt;pre&gt;
! XPM2
16 7 2 1
* c #ffffff
. c #000000
**..*...........
*.*.*...........
**..*..**.**..**
*.*.*.*.*.*..*.*
**..*..**.*...**
...............*
.............**.
&lt;/pre&gt;

	&lt;p&gt;Luckily MacVim understands this format and allows you to see it:
&lt;img src="http://degrunt.org/files/Picture_1.png" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Right now this image is on my &lt;span class="caps"&gt;NXT&lt;/span&gt; display &amp;#8211; inverse though, next is making the parsing a bit more flexible.&lt;/p&gt;


	&lt;p&gt;A good thing is that &lt;a href="http://www.pixelmator.com/"&gt;PixelMator&lt;/a&gt; can convert to &lt;span class="caps"&gt;XPM&lt;/span&gt;, so no manual editing of &lt;span class="caps"&gt;XPM&lt;/span&gt; files ;)&lt;/p&gt;


	&lt;p&gt;Now to see whether we can get the below image to show on the &lt;span class="caps"&gt;NXT&lt;/span&gt; screen (nope no colors):&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://degrunt.org/files/pblua.png" alt="" /&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 07 Jun 2008 01:05:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:0941514d-74aa-4e5d-a5e7-3bd9ebe0a820</guid>
      <author>Tom</author>
      <link>http://www.degrunt.org/articles/2008/06/07/xpm-xpixmap-and-pblua-nxt</link>
      <category>mindstorms</category>
      <category>nxt</category>
      <category>programming</category>
    </item>
    <item>
      <title>Getting a Lua program onto the NXT</title>
      <description>&lt;p&gt;In my last post, only yesterday, we&amp;#8217;ve seen how to install pbLua onto the &lt;span class="caps"&gt;LEGO NXT&lt;/span&gt;. Now we also want it to do something ofcourse.&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s first start with connecting to the pbLua-NXT again (using screen &amp;#8211; or a utility if you like) and at the &amp;gt; prompt copy and paste the whole following code:&lt;/p&gt;


&lt;pre&gt;
-- Replace HelloWorld on the next line, with the name of the program you want
fileName = "HelloWorld" 

-- Replace the text between [[ and ]] with your own program.
programText = [[
nxt.DisplayClear()
nxt.DisplayText( "Hello, World!" )
]]

h = nxt.FileCreate( fileName, string.len(programText) )
nxt.FileWrite( h, programText )
nxt.FileClose( h )
&lt;/pre&gt;

	&lt;p&gt;This now created a file called &lt;code&gt;HelloWorld&lt;/code&gt; onto your &lt;span class="caps"&gt;NXT&lt;/span&gt;. To now also run the program give the following command: &lt;code&gt;nxt.dofile('HelloWorld')&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;That&amp;#8217;s all there is to it, isn&amp;#8217;t it easy?&lt;/p&gt;


	&lt;p&gt;Remember that this procedure is not needed if you just want try the &lt;span class="caps"&gt;API&lt;/span&gt;, remember (if you checked yesterday&amp;#8217;s article) that we did &lt;code&gt;nxt.SoundTone()&lt;/code&gt; on the console.&lt;/p&gt;</description>
      <pubDate>Fri, 06 Jun 2008 20:26:06 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:69a85cba-0071-4461-843d-7c18c44ed18f</guid>
      <author>Tom</author>
      <link>http://www.degrunt.org/articles/2008/06/06/getting-a-lua-program-onto-the-nxt</link>
      <category>mindstorms</category>
      <category>nxt</category>
      <category>programming</category>
    </item>
    <item>
      <title>Lua on LEGO Mindstorm NXT</title>
      <description>&lt;p&gt;Wow! It&amp;#8217;s been a long time since I wrote here, but in the mean time cool things have happened. Firstly there&amp;#8217;s &lt;a href="http://www.hempeldesigngroup.com/lego/pbLua/"&gt;pbLua&lt;/a&gt;, secondly I bought myself a Lua book.&lt;/p&gt;


	&lt;p&gt;So, how now do you go about to install pbLua on your &lt;span class="caps"&gt;NXT&lt;/span&gt;? If you&amp;#8217;re using Windows, there&amp;#8217;s not really an issue, because that&amp;#8217;s all explained on the homepage. I&amp;#8217;m using a Mac, so here it is.&lt;/p&gt;


	&lt;h1&gt;Setup&lt;/h1&gt;


	&lt;p&gt;1) First download pbLua, I&amp;#8217;ve got a &amp;#8216;nxt-lua-beta-15b&amp;#8217; folder on my Desktop.&lt;/p&gt;


	&lt;p&gt;2) Start up &lt;span class="caps"&gt;LEGO&lt;/span&gt;&amp;#8217;s &lt;span class="caps"&gt;MINDSTORMS NXT&lt;/span&gt;&lt;/p&gt;


	&lt;p&gt;3) Use the Tools menu and use the &amp;#8220;Update &lt;span class="caps"&gt;NXT&lt;/span&gt; Firmware&amp;#8230;&amp;#8221; option, click &amp;#8220;Browse&amp;#8221; and navigate using the browser to the folder  &amp;#8216;nxt-lua-beta-15b&amp;#8217; on your Desktop. The window should show &amp;#8220;nxt-lua&amp;#8221; as &amp;#8220;Available Firmware Files&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;4) Now connect your &lt;span class="caps"&gt;NXT&lt;/span&gt;, click &amp;#8220;Download&amp;#8221; and wait &amp;#8230;.&lt;/p&gt;


	&lt;p&gt;5) If everything is correct, your &lt;span class="caps"&gt;NXT&lt;/span&gt; screen should show &amp;#8220;pbLua Beta 15b&amp;#8221;, the 15b depends on the version you downloaded.&lt;/p&gt;


	&lt;h1&gt;Okay now what?&lt;/h1&gt;


	&lt;p&gt;Now you&amp;#8217;ve got a Lua-enabled &lt;span class="caps"&gt;NXT&lt;/span&gt;, but it&amp;#8217;s not very clear how to continue further. Luckily it says &lt;a href="http://www.hempeldesigngroup.com/lego/pbLua/pbLuaStartupDisplay.html"&gt;somewhere on the homepage&lt;/a&gt; that there&amp;#8217;s a &lt;span class="caps"&gt;USB&lt;/span&gt; Console as well as a BT (BlueTooth) Console. 
Let&amp;#8217;s start with the &lt;span class="caps"&gt;USB&lt;/span&gt; Console.&lt;/p&gt;


	&lt;p&gt;1) Fire up Terminal.app&lt;/p&gt;


	&lt;p&gt;2) Do an &lt;code&gt;ls /dev/tty.usb*&lt;/code&gt;, in my case this shows a &lt;code&gt;/dev/tty.usbmodem1a21&lt;/code&gt;, but your results may vary.&lt;/p&gt;


3) Then do a &lt;code&gt;screen /dev/tty.usbmodem1a21&lt;/code&gt;, this should refresh your screen and show you:
&lt;pre&gt;
pbLua Beta 15b
&amp;gt; 
&lt;/pre&gt;

	&lt;p&gt;You&amp;#8217;re now in a Lua interpreter, type &lt;code&gt;print("Hello World!")&lt;/code&gt;, just for the kicks of it!&lt;/p&gt;


	&lt;p&gt;Basically you can now use the &lt;a href="http://www.hempeldesigngroup.com/lego/pbLua/nxtFunctionDefs.html"&gt;pbLua &lt;span class="caps"&gt;API&lt;/span&gt;&lt;/a&gt;, to do anything you want, try &lt;code&gt;nxt.SoundTone()&lt;/code&gt; for example, woohoo isn&amp;#8217;t that great?!&lt;/p&gt;


	&lt;p&gt;4) To quit the Console type Ctrl-a Ctrl-\.&lt;/p&gt;


	&lt;h1&gt;Enabling Bluetooth&lt;/h1&gt;


	&lt;p&gt;1) Basically you go about as you would connect any other Bluetooth device to your Mac, just select &amp;#8220;Any Device&amp;#8221;, find the &lt;span class="caps"&gt;NXT&lt;/span&gt; in the list of Devices and have the &amp;#8220;Use a specific passkey&amp;#8221; option selected for the Passkey Options.&lt;/p&gt;


	&lt;p&gt;2) During &amp;#8220;Gathering information about your device&amp;#8221; and while it&amp;#8217;s connecting, Mac &lt;span class="caps"&gt;OSX&lt;/span&gt; will ask you for a passkey, think of something, then go to your &lt;span class="caps"&gt;USB&lt;/span&gt; console and use the Lua function &lt;code&gt;nxt.BtSetPIN('something')&lt;/code&gt; (on your &lt;span class="caps"&gt;USB&lt;/span&gt; console) to confirm the bluetooth-passkey from your &lt;span class="caps"&gt;NXT&lt;/span&gt; end.
At some point Mac &lt;span class="caps"&gt;OSX&lt;/span&gt; will say &amp;#8220;Connected&amp;#8221;. Remember the device name!&lt;/p&gt;


	&lt;h1&gt;Bluetooth Console&lt;/h1&gt;


	&lt;p&gt;1) Reboot your &lt;span class="caps"&gt;NXT&lt;/span&gt; (by holding the grey button for some time) and start it again by clicking the orange button. Then you should see something like:&lt;/p&gt;


&lt;pre class="nxtDisplay"&gt;
USB Console
BT Console
. 
. 
. 
. 
. 
. 
00000 Button:0
&lt;/pre&gt;

	&lt;p&gt;Then use the dark grey button, to highlight BT Console, next use the arrow buttons to find the device name of your computer (which in my case is &amp;#8216;galactica&amp;#8217;).&lt;/p&gt;


&lt;pre class="nxtDisplay"&gt;
USB Console
BT Console
. 
.
galactica
AD:000000000000
CL:000000
ST:00 Idx: 00 
00000 Button:0
&lt;/pre&gt;

	&lt;p&gt;Once you&amp;#8217;ve got this selected, the screen should show:&lt;/p&gt;


&lt;pre class="nxtDisplay"&gt;
Wait for connect
Active: 00
Update:  0 
.
.
.
.
.
.
&lt;/pre&gt;

	&lt;p&gt;2) Fire up Terminal.app&lt;/p&gt;


	&lt;p&gt;3) Do an &lt;code&gt;ls /dev/cu.&amp;lt;bluetooth-device-name&amp;gt;*&lt;/code&gt;, in my case my &lt;span class="caps"&gt;NXT&lt;/span&gt; is called &amp;#8220;r2d2&amp;#8221; (yup!). So I did a &lt;code&gt;ls /dev/cu.r2d2*&lt;/code&gt;, this shows a &lt;code&gt;/dev/cu.r2d2-DevB-1&lt;/code&gt;, but your results may vary, depending on your device name.&lt;/p&gt;


3) Then do a &lt;code&gt;screen /dev/cu.r2d2-DevB-1&lt;/code&gt; (or whatever you found at step 2), this should refresh your screen and show you:
&lt;pre&gt;
pbLua Beta 15b
&amp;gt; 
&lt;/pre&gt;

	&lt;p&gt;Woohoo, wireless pbLua!!&lt;/p&gt;


	&lt;p&gt;More to follow, later, keep you posted &amp;#8211; check back!&lt;/p&gt;</description>
      <pubDate>Fri, 06 Jun 2008 00:39:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:00ba9a38-6c38-4f85-aa71-48953c2ec00a</guid>
      <author>Tom</author>
      <link>http://www.degrunt.org/articles/2008/06/06/lua-on-lego-mindstorm-nxt</link>
      <category>mindstorms</category>
      <category>nxt</category>
      <category>programming</category>
      <category>hacking</category>
    </item>
    <item>
      <title>Cross-compile Ruby to ARM7</title>
      <description>&lt;p&gt;Okay, I had another go at cross-compiling Ruby to &lt;span class="caps"&gt;ARM7&lt;/span&gt;, which for me (a cross-compile newbee) is not very simple.&lt;/p&gt;


	&lt;p&gt;I found this site of &lt;a href="http://www.jstuber.net/lego/nxt-programming/arm-toolchain.html"&gt;Jürgen Stuber&lt;/a&gt; which helps a little, but just running &lt;code&gt;./configure --host powerpc-apple-darwin8.8.0 --target=arm-elf&lt;/code&gt; does not seem to do the trick. I also found this &lt;a href="http://www.cpjava.net/arm-ruby.txt"&gt;page by Richard Keene&lt;/a&gt; which also points me in the right direction.&lt;/p&gt;


	&lt;p&gt;Well you will know my intention: Getting Ruby to compile for running the Lego &lt;span class="caps"&gt;NXT&lt;/span&gt; brick. We&amp;#8217;ll probably don&amp;#8217;t need socket, curses and libruby (maybe more), which will safe a lot of space. The next thing is to find out how small we can actually make the interpreter.&lt;/p&gt;


	&lt;p&gt;So does anyone have any tips, can somebody help me out? Is somebody willing to help? I&amp;#8217;m aiming to create a Ruby interpreter, which will run on the &lt;span class="caps"&gt;LEGO NXT&lt;/span&gt; device, which will load zipped .rb files and run&amp;#8217;s them.&lt;/p&gt;</description>
      <pubDate>Sun, 14 Jan 2007 14:28:59 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:b93aedf5-3756-46a1-9389-06555ae014a7</guid>
      <author>Tom</author>
      <link>http://www.degrunt.org/articles/2007/01/14/cross-compile-ruby-to-arm7</link>
      <category>nxt</category>
      <category>hacking</category>
    </item>
    <item>
      <title>Java OS for LEGO NXT</title>
      <description>&lt;p&gt;They&amp;#8217;ve done it! Just like for the &lt;span class="caps"&gt;RCX&lt;/span&gt; there is now Java for the &lt;span class="caps"&gt;NXT&lt;/span&gt;: &lt;a href="http://lejos.sourceforge.net/"&gt;leJOS&lt;/a&gt; is a firmware replacement for the &lt;span class="caps"&gt;NXT&lt;/span&gt; device. It currently does not  have bluetooth, sound and &lt;span class="caps"&gt;I2C&lt;/span&gt; support. There is also no menu system (yet!). But you can upload Java programs via &lt;span class="caps"&gt;USB&lt;/span&gt; and have your but execute them. Excellent!&lt;/p&gt;


	&lt;p&gt;But as you know I&amp;#8217;m a big Ruby fan, so if only it was Ruby instead of Java &amp;#8230; :)
Also, how can you fit a Ruby interpreter on 256 Kbytes &lt;span class="caps"&gt;FLASH&lt;/span&gt; &amp;#38; 64 Kbytes &lt;span class="caps"&gt;RAM&lt;/span&gt;. I know there is already ruby for 32-bit &lt;span class="caps"&gt;ARM7&lt;/span&gt; microcontrollers so &amp;#8230;&lt;/p&gt;</description>
      <pubDate>Sun, 14 Jan 2007 13:19:34 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:8a214521-ace0-4304-91d4-54ded53b4591</guid>
      <author>Tom</author>
      <link>http://www.degrunt.org/articles/2007/01/14/java-os-for-lego-nxt</link>
      <category>nxt</category>
      <category>hacking</category>
    </item>
    <item>
      <title>Mac OSX and Lego NXT stuff</title>
      <description>&lt;p&gt;From John Hansen I understood that there&amp;#8217;s nice &lt;span class="caps"&gt;OSX&lt;/span&gt; stuff for your &lt;span class="caps"&gt;LEGO NXT&lt;/span&gt; coming up or already there.&lt;/p&gt;


	&lt;p&gt;The first is a full-blown &lt;span class="caps"&gt;IDE&lt;/span&gt; for use with nbc/nxc called &lt;a href="http://forums.nxtasy.org/index.php?showtopic=719"&gt;NXTCode&lt;/a&gt;  . I must say: it looks good and I hope it&amp;#8217;ll get finished and released.&lt;/p&gt;


	&lt;p&gt;The second is a utility called &lt;a href="http://web.mac.com/carstenm/iWeb/Lego/NXT/F2F73940-D837-4038-9011-2968725A2872.html"&gt;NXTBrowser&lt;/a&gt;. It allows you to browse your &lt;span class="caps"&gt;NXT&lt;/span&gt; with &lt;span class="caps"&gt;OSX&lt;/span&gt;. It&amp;#8217;s a Universal binary so it runs on your &lt;span class="caps"&gt;PPC&lt;/span&gt; as well as your Intel Mac. Good stuff!&lt;/p&gt;</description>
      <pubDate>Thu, 11 Jan 2007 22:27:27 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:2d9f50b9-1495-4d0a-9ef7-7011e32c5941</guid>
      <author>Tom</author>
      <link>http://www.degrunt.org/articles/2007/01/11/mac-osx-and-lego-nxt-stuff</link>
      <category>nxt</category>
    </item>
    <item>
      <title>Drag &amp;amp; Drop NBC/NXC to RXE</title>
      <description>&lt;p&gt;Yesterday, I&amp;#8217;ve put together Dropnbc2rxe, with the help of &lt;a href="http://www.wsanchez.net/software/"&gt;DropScript&lt;/a&gt;. If you put Dropnbc2rxe in your Applications folder (it &lt;span class="caps"&gt;NEEDS&lt;/span&gt; to be there, due to hardcoded paths). Then if you would drop .nbc or .nxc files onto the application, it will compile them to .rxe files, to be put on your &lt;span class="caps"&gt;LEGO NXT&lt;/span&gt; device.
Dropnbc2rxe can be downloaded &lt;a href="http://www.degrunt.org/media/Dropnbc2rxe.zip"&gt;here&lt;/a&gt;. It has nbc 1.0.1.b20 bundled with it, no need to download that separate.&lt;/p&gt;</description>
      <pubDate>Wed, 10 Jan 2007 22:02:44 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:4fb8540f-f48c-460f-9e11-f95a30dca98e</guid>
      <author>Tom</author>
      <link>http://www.degrunt.org/articles/2007/01/10/drag-drop-nbc-nxc-to-rxe</link>
      <category>nxt</category>
      <category>hacking</category>
    </item>
    <item>
      <title>Ruby &amp;amp; Mindstorms NXT</title>
      <description>&lt;p&gt;Using &lt;a href="http://www.ruby-lang.org/en/"&gt;Ruby&lt;/a&gt; with your Mindstorms &lt;span class="caps"&gt;NXT&lt;/span&gt; is easy using &lt;a href="http://ruby-nxt.rubyforge.org/"&gt;RubyNXT&lt;/a&gt;. But it still requires a bluetooth connection or &lt;span class="caps"&gt;USB&lt;/span&gt; connection.&lt;/p&gt;


	&lt;p&gt;How cool would it be if it was possible to write a Ruby program, upload it (in sourcecode) to your &lt;span class="caps"&gt;NXT&lt;/span&gt; brick and have a Ruby interpreter firmware running on the &lt;span class="caps"&gt;NXT&lt;/span&gt;? It wouldn&amp;#8217;t be needed to port the whole &lt;a href="http://www.ruby-doc.org/stdlib/"&gt;Ruby Standard Library&lt;/a&gt;, it wouldn&amp;#8217;t even be needed to convert the whole &lt;a href="http://www.ruby-doc.org/core/"&gt;Ruby Core Library&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;So what would be needed to get this to work? Cross-compilation of Ruby to &lt;span class="caps"&gt;ARM&lt;/span&gt;, someone already &lt;a href="http://www.caliban.org/ruby/ruby-zaurus.shtml"&gt;ported Ruby to his Zaurus&lt;/a&gt;. A new firmare is needed.&lt;/p&gt;


	&lt;p&gt;Maybe better yet is the use of a Ruby VM like &lt;a href="http://www.atdot.net/yarv/"&gt;&lt;span class="caps"&gt;YARV&lt;/span&gt;&lt;/a&gt; and get that to run on the Mindstorms brick. Still, that needs to be cross compiled and a new firmware is needed.&lt;/p&gt;


	&lt;p&gt;Ruby is a fully object oriented programming language and is fairly easy to learn, even easier to use. More and more programmers learn Ruby.&lt;/p&gt;</description>
      <pubDate>Sat, 14 Oct 2006 11:29:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:cef68423-5a6c-4e37-99a4-7a2179c6a006</guid>
      <author>Tom</author>
      <link>http://www.degrunt.org/articles/2006/10/14/ruby-mindstorms-nxt</link>
      <category>mindstorms</category>
      <category>nxt</category>
      <category>programming</category>
      <category>hacking</category>
    </item>
    <item>
      <title>LibNxt on Mac OSX</title>
      <description>&lt;p&gt;Earlier I came across &lt;a href="http://nxt.natulte.net/trac/wiki/LibNxt"&gt;LibNxt&lt;/a&gt;, a project by David Anderson (one of the &lt;span class="caps"&gt;MDP&lt;/span&gt;&amp;#8217;s). As I&amp;#8217;m a Mac &lt;span class="caps"&gt;OSX&lt;/span&gt; user I tried to find out whether I could get &lt;strong&gt;fwflash&lt;/strong&gt; to run on &lt;span class="caps"&gt;OSX&lt;/span&gt;, well: &lt;span class="caps"&gt;IT DID&lt;/span&gt;!
What follows is a &lt;span class="caps"&gt;HOWTO&lt;/span&gt;.&lt;/p&gt;&lt;p&gt;Actually it&amp;#8217;s pretty easy if you have &lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt; installed:&lt;/p&gt;


Just do the following, it will all install neatly in &lt;code&gt;/opt/local/&lt;/code&gt;:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;sudo port install arm-elf-gcc
sudo port install scons
sudo port install libusb&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; 

	&lt;p&gt;If you&amp;#8217;ve downloaded LibNXT somewhere follow the instructions upto typing &lt;code&gt;scons&lt;/code&gt;, we need to change the &lt;code&gt;SConstruct&lt;/code&gt; file to this:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;from glob import glob

auto_libs = ''

# Detect the system's endianness
from sys import byteorder
if byteorder == 'big':
    endian = '_NXT_BIG_ENDIAN'
else:
    endian = '_NXT_LITTLE_ENDIAN'

BuildEnv = Environment(CCFLAGS=['-I/opt/local/include', '-Wall', '-std=gnu99',
                '-g', '-ggdb', '-D' + endian])
if auto_libs:
    BuildEnv.ParseConfig('pkg-config --cflags --libs ' + auto_libs)

BuildEnv.Command('flash_routine.h',
         ['flash_routine.h.base',
          'flash_write/flash.bin'],
         './make_flash_header.py')

Default(BuildEnv.Library('nxt',
             [x for x in glob('*.c')
              if not x.startswith('main_')],
             LIBS='usb'))

Default(BuildEnv.Program('fwflash', glob('main_fwflash.c'),
             LIBS=['usb', 'nxt'], LIBPATH=['.','/opt/local/lib']))
BuildEnv.Program('sambaget', glob('main_sambaget.c'),
         LIBS=['usb', 'nxt'], LIBPATH=['.','/opt/local/lib'])&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Once this is done you can type &lt;code&gt;scons&lt;/code&gt; and &lt;code&gt;scons sambaget&lt;/code&gt; which will give you the two utilities you were looking for: &lt;strong&gt;fwflash&lt;/strong&gt; and &lt;strong&gt;sambaget&lt;/strong&gt;.&lt;/p&gt;</description>
      <pubDate>Thu, 12 Oct 2006 19:40:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:aef8754a-16ff-499c-a99b-27ef09b96366</guid>
      <author>Tom</author>
      <link>http://www.degrunt.org/articles/2006/10/12/libnxt-on-mac-osx</link>
      <category>mindstorms</category>
      <category>nxt</category>
      <category>hacking</category>
    </item>
    <item>
      <title>NXT Linux</title>
      <description>&lt;p&gt;Just a short article on thoughts for a Linux for Mindstorms &lt;span class="caps"&gt;NXT&lt;/span&gt;. How hard would it be to do something similar as &lt;a href="http://www.ipodlinux.org/Main_Page"&gt;iPod Linux&lt;/a&gt; with the &lt;span class="caps"&gt;NXT&lt;/span&gt; brick, ie a &lt;span class="caps"&gt;LEGO&lt;/span&gt; Mindstorms &lt;span class="caps"&gt;NXT&lt;/span&gt; running &lt;a href="http://www.uclinux.org/"&gt;&amp;mu;CLinux&lt;/a&gt;? The Mindstorms &lt;span class="caps"&gt;NXT&lt;/span&gt; is based on the &lt;a href="http://www.atmel.com/dyn/products/product_card.asp?part_id=3524"&gt;Atmel &lt;span class="caps"&gt;AT91SAM7S256&lt;/span&gt;&lt;/a&gt;, it&amp;#8217;s a microcontroller. &lt;a href="http://www.jstuber.net/lego/nxt-programming/index.html"&gt;Jurgen Stuber&lt;/a&gt; already hints at programming for the Mindstorms &lt;span class="caps"&gt;NXT&lt;/span&gt; using a cross-compiler.&lt;/p&gt;


	&lt;p&gt;As far as I understand the latest generation iPod is also based on &lt;a href="http://www.portalplayer.com/products/documents/5020_Brief_0108_Public.pdf"&gt;&lt;span class="caps"&gt;ARM7&lt;/span&gt; processors&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;With the help of something like &lt;a href="http://sdcc.sourceforge.net/"&gt;&lt;span class="caps"&gt;SDCC&lt;/span&gt;&lt;/a&gt; it should be possible to then build C programs (or the like) for the &lt;span class="caps"&gt;NXT&lt;/span&gt; brick.&lt;/p&gt;


	&lt;p&gt;I guess it&amp;#8217;s just time which will tell.&lt;/p&gt;</description>
      <pubDate>Thu, 12 Oct 2006 11:15:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:f3825b54-c5c2-4b68-991b-6e304c98ba54</guid>
      <author>Tom</author>
      <link>http://www.degrunt.org/articles/2006/10/12/nxt-linux</link>
      <category>mindstorms</category>
      <category>nxt</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
