Introduction
My hobby projects seldom reach the finish line, why is that?
Well there are a couple of reasons I can think of.
- Some hobby projects are intended for learning purposes only
- Some projects aren't delimited
- Suboptimization
Constraints force us to think more creatively, respect the time available and to be pragmatic.
I did not have any actuators or sensors at home when the "Making tech at home" contest was announced. But I do have children and an old Lego education set [RCX].
Background
Useless machines have been around for quite some time [useless].
I'd prefer not inventing the wheel again, so I looked at available options in the prototyping stage of the project:
Development
I like to reason that project building blocks should be re-useable and shippable. Why? Re-use implies low coupling to the project. Shippable implies accountability; and if open source, auditability. Auditable code in it self forms an incentive to write better code.
Since I'm developing on Linux and didn't have the Lego development environment available I decide to go with the [NQC, "Not Quite C"] tool. There was other candidates too, such as LeoJOS, and RobotC. I have a strong preference for C but RobotC was from what I could derive not available for Linux.
NQC is both a compiler as well as the program used to download the code to the RCX.
It also provides a function for sending op codes to the RCX, "nqc -raw", which allows you to execute op codes remotely.
This is useful in a number of cases, e.g. testing motors or auditing variables on the RCX at runtime.
Prototyping should be easy, fast and testable but the NQC did not provide a software API. So I wrote as python wrapper for the CLI, [pynqc], if you have an RCX lying around, try it out (and of course, review the code :) ). I wrote it in python, as it has a low prototyping threshold and allows for fast development when prototyping.
I built the physical machine in Lego and modelled it afterwards with BrickLinks Stud.io
BrickLink was a great tool and except for modelling it also generated instructions and provided rendering and exports to a number of other file formats.
So, here comes a demo! Code and model is available at: https://gitlab.com/solsjo/useless-box