Lego Mindstorms RCX 1.0

Date:2015-01-16 13:24:00

I had a, probably around 10 to 15 year old, box with a Lego Mindstorms RCX 1.0 sitting in my basement. I thought I could not use it anymore because the control tower needs a serial connection and I do not own a computer with a serial connection anymore. However, recently a friend told me that there are serial to USB adapters and that they even work nicely under Linux :-) He recommended the Digitus USB to Serial DB9 adapter and I followed that advise. The adapter cost me around 11 EUR. But I do not know if there are other, cheaper, better, ... adapters. On my Debian Wheezy I had nothing to do than plugin it in. The kernel recognised it immediately and loaded all needed drivers. Now, I needed a compiler to run some code on the RCX. My fried recommended Bricx Command Center 3.3. However, that the program seems not to exist for Debian. But their webpage forwarded me to the brickOS project. Their compiler seems to be dead since 2004 but surprisingly there are Debian packages for it:
# aptitude install brickos brickos-doc
My first try to use brickos failed but that was because the contacts in my RCX and the tower were corroded. Probably because of some battery leakage years ago. I was able to polish them clean using sand paper. After the installation and after I plugged the (cleaned) tower in and started the RCX I was able to upload the brickOS operating system to the RCX:
$ sudo chmod 666 /dev/ttyUSB0
$ export RCXTTY=/dev/ttyUSB0
$ firmdl3 /usr/lib/brickos/brickOS.srec
I did not read much documentation, but I assembled my first program using the demo programs shipped with the brickOS package. They can be found in:
Those demos included two makefiles. One for C and one for C++ code. I used the C++ Makefile to compile my own code and uploaded it to the RCX using:
dll NameOfYourFile.lx
And now a little rover is running around in my flat :-)