Added a few more lines to my first python script in order to achieve ‘Record and Play’ functionality, like the original LEGO Code Pilot.
Also change a bit the structure of the dicitionary, adding the code to execute to each “barcode item”. So the recording part is just adding “items” to a list and the playing is just a loop through the list, picking the code and executing it with the ‘exec’ function (kudos to Daniel Walton).
So ‘codepilot03.py’ is now able to record an undefined number of steps and execute them in a row. And since the barcode scanner is fully Plug and Play we can detach it and reattach it between runs (and since wi-fi is not needed, we can also remove the clumsy USB hub).
Next version will have an extended “language set”.