This is how I managed to get NQC working for the Robotics Invention System on my laptop, running Ubuntu 7.04 Feisty Fawn, with the USB Lego Infra-red Tower. Anything with a black background should be executed in a terminal.
- Plug in your USB IR Tower
sudo mkdir /dev/usb/sudo ln -s /dev/legousbtower0 /dev/usb/lego0 (Edit: For the latest versions of Ubuntu, the first path may need to be /dev/usb/legousbtower0, according to Scott.)
sudo chmod 666 /dev/usb/lego0echo test > /dev/usb/lego0(Look for a green light to flash on the IR Tower. If you see it, then all is well.)- Download the latest source of NQC from the NQC Website.
- Put it in its own folder, and untar/gzip it:
tar -xvzf nqc-[Hit tab to fill in the rest] - Open the Makefile:
gedit Makefile - Remove the ‘#’ before this line: USBOBJ = rcxlib/RCX_USBTowerPipe_linux.o
- Save and close the Makefile.
mkdir rcxlib/LegoUSB/cd rcxlib/LegoUSB/wget http://legousb.cvs.sourceforge.net/*checkout*/legousb/LegoUSB/drivers/linux/include/legousbtower.hcd ../../sudo makesudo make installexport RCX_PORT=usb(You should also add this line to the bottom of the .bashrc file in your home folder:echo export RCX_PORT=usb >> ~/.bashrc- Try it out:
nqc -msg 7(You should see the green light come on on the IR Tower, and you shouldn’t get any message in the terminal. - If it works, you should be ready to use NQC! If you need to install the RCX Firmare, insert the Robotics Invention System CD, and run this command:
nqc -firmware /media/cdrom/firm/firm0309.lgo - Download the test program:
nqc -d test.nqc(This should put a program in slot 1 of the RCX which will just turn on Motor A.
Edit: Mike has a followup article where he explains how to set up the first three steps so they happen automatically when you plug in the IR Tower.
Kudos to this article for putting me on the right track.
My name is