It's been a long time but I believe enable remote sensing only works with the PicoBoard...but maybe my memory fails me....michpern wrote:In theory, this should possible via Python and this is exactly what I am trying to do.
I have a solution in two halves but I can't join them together yet because of an issue with Scratch on the Pi.
a) It is possible to access the GPIO from python code. I set up a basic LED circuit and wrote a couple of python scripts (one to turn the LED on and one to turn it off). This is working fine.
b) It is possible for a Python script to listen for (and send out) Scratch broadcast messages. I wrote a two-'block' Scratch program to test this - on Windows. I had a python script listening for a message and just output some text when it got the message.
Now the fun part. In order for this to all work, the "remote sensing" feature of Scratch needs to be turned on. [ To do this, select the Sensing blocks and then right-click on one of the two "sensor" blocks (normally at the bottom of the panel. One of the menu options is "enable remote sensor connections"] Unfortunately this gives an error "a primitive has failed".
I'm trying to track this down but I'm not a Smalltalk programmer. I'll report back if I find a solution.
Of course, there may be other ways to do this in Scratch
Any chance of an expanded explanation of the steps you used to get Scratch to talk to the GPIO pleasemichpern wrote:I
I have managed to get this working in the way I described previously, with no changes to Scratch.
Thanks for posting this Simon, looking forward to trying it out myself at the weekendsimplesi wrote:I've been playing with this (I want to use it in primary schools)
I've posted my experiences so far on a blog
http://cymplecy.wordpress.com/2012/07/2 ... pberry_pi/
is the main one but there are others and some youtube vids of my efforts
hope this helps
Users browsing this forum: No registered users and 3 guests