trarbab wrote: ↑
Wed Sep 12, 2018 8:06 pm
I'm trying to automatically run a Scratch 1.4 program that uses GPIO pins to control switches and LEDs.
I am not sure that is possible.
You can probably automatically launch the Scratch 1.4 graphical IDE environment, perhaps even get it to load a specific Scratch 1.4 program when it starts, but I'm not sure you can get Scratch 1.4 to automatically run that.
There is no reason the IDE couldn't automatically 'click the green flag', start a program running once it's loaded it, but I didn't think there was any capability for actually doing that. You might be able to convince the developer to add that capability if it doesn't exist.
I would see if you can get it to do that before moving on to getting it do that when booting.
Unfortunately Scratch is a visual programming environment where a block's action is interpretively decided when the Scratch environment runs it. There is not often a compiler which can take those blocks and convert them to native executable code.
You can find some utilities to convert Scratch projects into things which can run natively, for example https://phosphorus.github.io
, but I don't know if that supports 1.4 or whatever blocks you are using which are Pi specific.
You might be better off manually translating your Scratch program to Python or something which can be more easily executed from the command line, when booting. I suspect that would be your best course of action.
If you can point us to what you have found on line there may be additional help which could be given regarding that.