?

Log in

No account? Create an account
Wakum Mata!
Politcally Incorrect Musings
Legos and Linux 
2nd-Oct-2010 04:47 pm
robot
Woot!

I got my Lego Mindstorms RCX2 platform programmed under Linux using the USB tower and Not Quite C (NQC). I just now, this moment, downloaded the firmware.

Now to try the test program:


task main () // main program
{
SetPower(OUT_A, OUT_FULL); // turn on motor A at 100% power
OnFor(OUT_A, 200); // let the motor run for 2 seconds, then turn it off
}



WORKS!!!

The trick came from Trevor Creech:

# 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/lego0
# echo test > /dev/usb/lego0 (Look for a green light to flash on the IR Tower. If you see it, then all is well.)


Scott is correct in that the lego USB tower appears under /dev/usb under Ubuntu (I am using Kubuntu).

And from the NQC FAQ, you need to use the "-Susb" argument to force USB and not serial.

It is unfortunate that there is no IDE available for Linux. Everything is from the command line. Oh well. I wonder if I can make NQC work with Eclipse. Perhaps I can write a Perl or Java GUI wrapper. More for the to do list. Deadline: someday.
This page was loaded Nov 21st 2018, 2:02 am GMT.