Hi does anyone know where I can download and how to install control for GPIO on the weeze scratch?
Its so much fun to use scratch but its kinda limited to visual efect only, Id like to use it for comunication with the outside world.
Hi does anyone know where I can download and how to install control for GPIO on the weeze scratch?
Its so much fun to use scratch but its kinda limited to visual efect only, Id like to use it for comunication with the outside world.
A lot of useful work has been done by cymplecy (a teacher in the uk) into using Scratch on the Raspberry Pi to control the GPIO. Follow his instructions and you should be up and running fairly quickly.
http://cymplecy.wordpress.com/2013/04/22/scratch-gpio-version-2-introduction-for-beginners/
Make sure that you have updated to the latest version of Raspbian (sudo apt-get update; sudo apt-get upgrade) as Scratch has been patched to improve performance and to fix some annoying bugs that were present in the earlier versions.
Scratch 2.0 is not particularly useful as it doesn't run on the pi (its a web based application) and it cant access the GPIO.
Hope this helps.
I checked this out and I cant seem to install it it shows file or path not found or sintax error when I try the sudo /boot/install instruction like the page describes.
Do you know how to download it correctly because the instructions on the page arent working.
Hi Marcelo,
Ok so the installer thinks it has completed with no errors.
Is there a sub-directory called simplesi_scratch_handler in your /home/pi directory ? if it does exist, does it contain two files scratch_gpio2.sh and scratch_gpio_handler2.py ?
If the two files are there then try using LX Terminal to run the scratch_gpio2.sh script directly:
cd /home/pi/simplesi_scratch_handler
./scratch_gpio2.sh
This should open the scratch window. If not do you get any error messages ?
Neil
Why appear as Scratch 1.4?
Version 1.4 is correct. The next version is 2.0, which is available to use online,
rather than as a download.
Hi Marcelo,
I am glad it is now working for you.
As coder27 said scratch 1.4 is the current version for the non web based version. Version 2.0
This is the second version of Simon's (Cymplesy) scratch GPIO handler hence the scratch_gpio2.sh. filename. For tutorials etc see http://cymplecy.wordpress.com/2013/04/22/scratch-gpio-version-2-introduction-for-beginners/
Have fun.
Neil
Hello,
I am new to the raspberry Pi, and I am getting frustrated... Anyway, I am stuck with
chmod /home/pi/install_scratch_gpio2.sh
When I tried the previous command, it says: chmod: missing operand after /home/pi/install_scratch_gpio2.sh
Please help.
chmod changes the permissions on a file. You have told it which file, but not what permissions you want to apply.
You probably want to make the file eXecutable, so that it can be run as a program.
So
chmod +x /home/pi/install_scratch_gpio2.sh
The manual pages are your friends. Try "man chmod" for all you ever wanted to know about the chmod command, (or any other command).
Thank for for your response.... Still nothing...
I tried
chmod +x /home/pi/install_scratch_gpio2.sh
and I got:
chmod: changing permissions of `/home/pi/install_scratch_gpio2.sh' : Operation not permitted
ok , that suggests that the user running the command (pi?) does not own the file.
try
ls -l /home/pi/install_scratch_gpio2.sh
The output will contain, amongst other things, the name and group of the owner. You might expect it to be "pi pi". I suspect that it wil be "root root".
(Looking back over this thread, the file was fetched using "sudo wget..." so will belong to root. That "sudo" isn't really necessary)
So now you have 2 options:
1) change the owner to pi with "sudo chown pi:pi /home/pi/install_scratch_gpio2.sh", then retry the chmod.
or
2) run the chmod command as the root user "sudo chmod +x /home/pi/install_scratch_gpio2.sh"
You were right... It was root root
I changed the ownership to pi (I doubled check it with the file manager)
When I entered " ls " the file changed to yellow
but it doesn't install when I try to run sudo /boot/install_scratch_gpio2.sh
I am feeling awful for asking so many questions sorry...
but it doesn't install when I try to run sudo /boot/install_scratch_gpio2.sh
What's the error message you're getting?
Did you download install_scratch_gpio2.sh into /boot or /home/pi?
but it doesn't install when I try to run sudo /boot/install_scratch_gpio2.sh
What's the error message you're getting?
Did you download install_scratch_gpio2.sh into /boot or /home/pi?
It is working now...! I had to run it from the /home/pi
THANKS!
Guys... Please, what am I doing wrong? It indicates an indentation error - line 7
import time
import RPi.GPIO as GPIO
GPIO.cleanup()
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7,GPIO.OUT)
while True:
GPIO.output(7,GPIO.HIGH)
time.sleep(1)
GPIO.output(7,GPIO.LOW)
time.sleep(1)
You need to indent the line(s) following a "while" loop to show
which lines are part of the loop. So instead of:
while True:
GPIO.output(7,GPIO.HIGH)
time.sleep(1)
GPIO.output(7,GPIO.LOW)
time.sleep(1)
you probably want:
while True:
GPIO.output(7,GPIO.HIGH)
time.sleep(1)
GPIO.output(7,GPIO.LOW)
time.sleep(1)
Thank you!