a quick report on this.
I manged to get the PI act as firing system to launch fireworks.
The PI ran headless with 5 push buttons connectted to the GPIO pins. 1 button was used to "arm" the system and 4 buttons to "fire" 4 relays. These turn ignited the Talon fuses clipped onto the fireworks.
In the field the Pi was powered by a 12V tractor battery using a car lighter phone charger.
THe key to running was getting scratch to launch at the start (Intructions can be found elsewhere on how to boot straight in Xwindow and launch an application on start up in this case the Scratch project.
HERE comes the interesting party for SCRATCH users
My Scratch GPIO setup is SimpleSi Scratch set up (thanks Simon)
My main problem was getting Scratch to auto start, running with a head I would click on the green flag but in this project all I had was a push button droping the voltage on Pin7 to 0V
The auto start is resolved by using the "When I recieve " block . In my case it was "When I recieve 'ARM' " this would when look to see if the firing signal pins voltages were zero or 1. IF the were zero the firing relay pin was set high.
The "when I recieve" block listened for BROADCASTed Messages, which can be generated by Scratch internally or SimpleSi python script. However in its original form SimpleSi python program presently only uses one type of message and for this purpose it is the wrong type
Message types are dealt with in the 4th post of this topic http://scratch.mit.edu/forums/viewtopic.php?id=9458
SimpleSi code concentrates on sending and recieving messages of this type
sensor-update <var-name_1> <new-value_1> ...
I hacked SimpleSi code to add
when the armed push button was pushed and
when it was released
On pushing pin7 ARMED was broadcast and Scratched recieved the ARMED message
I had issues with getting scratch to recieve certain <sting>s. Inthe end i opted for a string of a single word with no white space or quote marks. (I would of original like to have broadcast messges like PIN07 low or High but i could get no reaction from Scratch in this format but a single word worked)
My hack was very simple as time was limited. if you look at SimpleSi Python code and find the point that it prints the <Broadcast String>:
sensor-update <var-name_1> <new-value_1>
I add if the string is"sensor update" pin7 low then also broadcast the message ARMED.
Using this method you could truely run the PI headless and independently but responding to GPIO input to activate a program. No need to wireless or PuTTY in. starting a Pi robot navigating through a maze?
If you want to see the Pi at work
(Joke) This was not me!
last tip for now if you are running headless, tidy up the program before running it.. In developement I had a lot of variable dispayed on the stage. MAke sure to remove these beofer going headless else scratch runs slow.