C and Erlang code for the BrickPi Lego interface for the Raspberry Pi