What is current best practice for Snap user to use MicroBlocks / IoT?

Is there a version of Snap that integrates MicroBlocks in some form? Like John Maloney demo'd Aug '21, perhaps?

If not, is current recommendation to just use plain MicroBlocks?


Track down these guys:

I think they can set you up.

There is no standard integration per se between SNAP and MB. However, there are practices supported by both that will assist one in achieving various levels of integration, depending on the nature of the project at hand.

Basic communication bw the two is based on the messages emitted by the VM of the MB environment. The demo you are referring to was making use of the "broadcast" facility. Similarly, there are other VM messages that let one read and set variables, start and stop block code sets, etc. MB Wiki section " Interacting with Snap! | MicroBlocks Wiki" has examples that illustrate the various techniques.

MB also supports serial comms separate from the USB channel. By combining this with a serial comms on SNAP side, one can use Bluetooth or straight UART style interaction bw the two environments. This method is preferable for the implementation of the user's own interaction protocol.

Besides the methods used over the serial USB interface, there are also possibilities of interaction using the http server feature, as well as a simple but effective method of using the clipboard for large data and code transfers. Please check out the examples and let us know if we can be of further help.

In addition to what Turgut says, both Microblocks and Snap! now have the ability to pass messages via an MQTT broker (as long as the Microblocks device has networking abilities such as ESP boards - but not for the Microbit)

As you can see, there are several ways to integrate Snap! and MicroBlocks if you're interested in projects that combine the two systems. Examples of that include using a micro:bit as a Snap! game controller or using Snap! to collect and visualize data from sensors.

On the other hand, if you'd just like to explore physical computing, you may want to just use MicroBlocks directly. MicroBlocks coding is similar to Snap!, so if you know Snap! you'll find it easy to get started, and you'll be able to create stand-alone microcontroller projects that are portable and don't need to be connected to a laptop. For example, you could program a string of LED's to create a light saber for a halloween costume or add a motion sensor to your skateboard.

Even if you play to eventually create projects that integrate Snap! and MicroBlocks, I recommend exploring MicroBlocks by itself first. Because it is a live system like Snap!, it's a quick way to explore features like the light, temperature, and motion sensors in the micro:bit. And like Snap!, MicroBlocks runs right in the Chrome or Edge browser. To get started, visit the Get Started page on the MicroBlocks website.

I'd like to have the honour of welcoming John to the forum :slight_smile:


Thanks for the welcome, Cymplecy.