FOSS Advent Calendar - Door 8: Programming LEGO Robots with NQC

Today we explore NQC (Not Quite C), a wonderfully nerdy and lightweight programming language for the classic LEGO Mindstorms RCX robot brick.

Inside the RCX lives a tiny 8-bit Hitachi H8/300 CPU running at about 16 MHz together with 32 KB of RAM. Even with this extremely small hardware budget, the RCX can handle multitasking, read sensors, control motors and communicate via infrared. It feels like pure retro embedded magic.

NQC lets you write C-like programs on your computer and upload them directly to the RCX. It is minimalistic, fast, easy to learn and perfect for anyone who loves old-school robotics or wants to revisit the early days of DIY programming before Raspberry Pi and Arduino existed.

Working with NQC is a wonderful reminder of how much creativity is possible with almost no resources. Watching a tiny 32 KB robot happily execute parallel tasks still feels incredibly charming today.

Pro tip: If you still have an RCX somewhere, power it up. These yellow bricks are more alive than you remember once you start programming them again.

Link: https://github.com/BrickBot/nqc

Which small robot would you build or revive with the RCX?

#FOSS #OpenSource #Linux #CLI #Terminal #NQC #Mindstorms #LEGO #RCX #Robotics #Embedded #RetroComputing #NerdContent #AdventCalendar #Adventkalender #Adventskalender #TechNerds #STEM #Programming #Fediverse #FOSSAdvent #OpenTools #Robotik #OldSchoolTech

After a long time, I've written another blog post. It's about the recent fun I had with the #LEGO #Technic + #Mindstorms (#RCX) plotter. I've also published my #NQC code there.

https://maehw.wordpress.com/2024/06/17/building-a-lego-technic-mindstorms-plotter/

Building a LEGO Technic + Mindstorms plotter

Recently, I bought a used LEGO Technic 8094 set. The set dates back to 1990 and some people speak of it as the first programmable LEGO set in history – which is not quite the truth. The set w…

Tech and reverse engineering

Another iteration of the #LEGO #Technic + #Mindstorms #RCX based pen #plotter – based on set 8094. I finally understood how to retain the pen as intended by the original instructions - must have missed that before. Also added the "pen up/down" feature (another motor) - and this is why you do no longer see the inter-connecting lines from my last post. But, the pen is wobbly... and so are the lines now. Not too happy with this result. But it works. Used #WebPBrick + #NQC.

https://chaos.social/@maehw/112604455188626952

Mäh W. (@[email protected])

Attached: 2 images Found some more free time to work on the #LEGO #Technic + #Mindstorms #RCX based pen #plotter – based on LEGO set 8094. Thanks for pointing me to the Commodore 1520 plotter from where I took the encoded letters of the font from ROM and converted it to segment movements. The font can by the way be found as "FifteenTwenty" for the computer ‐ which helped me to have a reference. Still need to add a "pen up/down" feature and fix other issues... but it works. Kinda.

chaos.social
I've rebuilt Ben Williamson's "analog clock" #LEGO model which uses the #Mindstorms #RCX. Unfortunately, I do not have the fiber-optic component which he had used as rotation sensor. The rotation sensor I have still needs have its broken wire fixed. The clock gear defines a ratio so that the it needs to be driven with 48 discrete steps per hour (4 out of 5 minutes). Its programmed in #NQC. Mike Brandl has shared the PDF manual for this ancient technology on his website: https://lego.brandls.info/legbau.htm
legbau

Danke an die Teilnehmenden meines Talks auf dem 20. Augsburger Linux-Infotag "#LEGO #Mindstorms #RCX reaktivieren: Entwicklungen im Webbrowser" (u.a. https://webpbrick.com). Im Nachgang sind wir teilweise noch ins Gespräch gekommen und konnten ein wenig experimentieren. Die Folien zum Vortrag findet ihr unter anderem auch hier: https://www.luga.de/static/LIT-2024/talks/lego_mindstorms_rcx_reaktivieren_entwicklungen_im_webbrowser/

https://www.luga.de/LIT-2024/ #lit2024 #Augsburg #Linux #OSS #LEGO #mindstorms #rcx #nqc

RCX programmable brick web IDE (prototype)