Are there plans to create a Raspberry Pi GPIO extension in the Snap! libraries? I'd like to use the Snap! and raspberry pi in the same way I have used Scratch to demo physical computing https://projects.raspberrypi.org/en/projects/physical-computing-with-scratch to my students - lighting leds, buzzers, buttons, etc.
Check out micrBlocks and Mozilla WebThing Server features (http://microblocks.fun/blog-2020-01-15-microblocks,-snap!,-and-the-web) . Integrates very nicely with Snap via the HTTP interface. And I believe there are more feature / functionality to come.
It looks like @cymplecy maintains the Scratch GPIO extension. After poking around, I realized that this is an extension for Scratch running on a Raspberry Pi, not on your laptop, or desktop. That's cool, but a generic web interface to the Pi would be awesome, if not as responsive.
Did You try
It's Raspbery GPIO serverlet controlled by http.
So it should be possible to interact using Snap! built-in "url" reporter.
It's be cool to work on this, but I have no time
Maybe @cymplecy would want to give it a try? Or maybe @jguille2 or @jferran6 already know of an existing solution?
I've interfaced Snap in the past to my ScratchGPIO setup as POC but never put it all together as a package with instructions.
The main reason for not doing it, is that Scratch 1.4 does an excellent job of being a front end for controlling physical computing devices through the Raspberry Pi.
The extra stuff that Snap brings to the table isn't needed and Scratch 1.4 has such a small footprint, that it can run natively even on a PiZero.
But I did a lot of work last year to get Scratch 3 to interface to ScratchGPIO (bit of a waste of time as it only runs reliably and quick enough on a Pi4 with >1GB RAM), so maybe it wouldn't be too hard to re-purpose that and try putting a Snap deployment together
So You do not even consider using Scratch Interface Device (SID) with Snap?
Publicly available sources of SID (https://github.com/cymplecy/sid) and Scratch2GPIO (https://github.com/cymplecy/Scratch2GPIO) seems quite outdated (6 years) but looks promising ...
Finally got round to start using Snap! as the interface to my ScratchGPIO python handler - hopefully I'll document and publish it properly this time
Cool!
will this only run on Linux?
The Snap! session is running on my Win10 PC.
There is a webserver running on the Pi and Snap! communicates with it via the url block.
So Snap! can be run on any machine that is on the same network as a Pi (or the Pi itself)
Nice!
Making a lot of progress
Loving how I can make custom blocks like the matrix one - all in Snap! itself
I think it would be better if you used booleans instead, that way you won't have to put if item i of pixels = 1, you could just do if item i of pexels.
Good idea
Was just my first simple "lets get it working" stab at doing this
I think I really need to upgrade my neopixel python handler so I can just send the whole list list as one messsage and get it do the looping. It would work a lot quicker that way
ok
Updated my receiving Python program to take in a comma separated list of the all the pixels
The images display MUCH faster (0.7 secs to run the script to display S N A P)
Going to add a scroll option I think next
Not sure if I'm actually getting close to a deployable solution but having great fun playing with all the possibilities
Can this thread be put into the new Computer Science: Physical Computing category please