[squeak-dev] Talking to the real world from Squeak on a Rasppi
djm1329 at san.rr.com
Fri Apr 11 15:31:01 UTC 2014
I also had success playing with some Scratch-Python connections. Here's some notes I made experimenting with it a few months ago.
(playing with the scratch-gpio python hack)
sudo wget https://dl.dropbox.com/s/gery97qildl7ozd/install_scratch_gpio.sh -O /boot/install_scratch_gpio.sh
This installs a new desktop icon "scratch-gpio", which, when clicked starts scratch and a python script "scratch_gpio_handler.py". Scratch connects to this python script over a tcp socket and receives scratch "broadcast" messages, which, if are "pin12high", "pin18off" type messages then the appropriate function from RPi.GPIO is invoked.
Note: had to update the python script "scratch_gpio_handler.py" to initialize GPIO as BCM instead of BOARD. Also added a new GPIO 23 as output. Note that the array GPIO_NUM isn't used at all ... not really sure what it is for since the entries in the PIN_NUM array are GPIO numbers themselves.
These guys appear to have even better support ... not just GPIO but I2C, SPI, etc
There's also OSProcess. The plain Squeak interpreter that ships with recent raspian will work if you install OSProcess and OSShell. I used that to invoke pyhton scrips directly instead of over a socket.
With tons of help from Eliot and Tim I am currently adding support for ThreadedFFIPlugin for the pi's ARM (and hopefully other ARMs too). I'm hoping to have something basic ready in a couple of weeks.
On Apr 11, 2014, at 07:23 , Herbert König wrote:
> how do I use the camera and do IO on the Pi from Squeak?
> I managed to connect two Squeak images on the Pi via UDP so I think I could write (copy :-)) some python to do the IO and talk to Squeak via sockets.
> Are there alternatives? Plugins? How does Scratch do it?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev