Sometimes it can be useful to make your Pi autorun something when it is switched on.
With ScratchGPIO, you can autorun a Scratch program (it doesn’t have to be one controlling the GPIO pins but ScratchGPIO is needed to make it autorun
There are 2 steps
Create Linux Script
Run LX Terminal
mkdir -p /home/pi/.config/autostart
cd /home/pi/.config/autostart
nano scratchauto.sh
then type in following
cd /home/pi/scratchgpio5
sudo python scratchgpio_handler5.py &
scratch “/home/pi/Documents/Scratch Projects/autostart.sb”
If using ScratchGPIO6Alpha then do this instead
cd /opt/scratchgpio6alpha
sudo python scratchgpio_handler6.py &
scratch “/home/pi/Documents/Scratch Projects/autostart.sb”
CTRL-X then Y to save
chmod +x scratchauto.sh
Create a Scratch Autostart script
Make the Scratch script include the following in its On Green Flag Event
Then press the Green Flag to set AutoStart to True and save it in /homepi/Documents/Scratch Projects as autostart.sb
Reboot your Pi and it should automatically run the Scratch autostart.sb file
Simon
Don’t know what or if I am doing anything wrong – but can NOT get sGPIO6 to run with the RTK-003 board – also tried the ‘broadcast’ method for Pyonkee – but NoGo with sGPIO6 ; tested on both B and B+
Used these comands to install GPIO6:
wget http://git.io/nFwadg -O isgh6alpha.sh
sudo bash isgh6alpha.sh
jazza
really useful tidbit – THANKS!