microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
710 stars 586 forks source link

Real time data I/O for simulator (not real device) #4518

Open toysonlocation opened 2 years ago

toysonlocation commented 2 years ago

We have some students who do not have access to a real microbit, so the sim is their only tool. Although our projects ultimately use the real microbit to drive simple vehicles, for development we want to provide students with a separate virtual environmental sim (visualization) where data is piped in from the microbit sim, processed/rendered, and updated "sensor" state is piped back into the microbit sim. At the moment, I can't figure out how to get real time data to/from the sim and an external process. Is there a simple mechanism already built-in for this? If not, is it problematic to create an extension that connects to an external process via functions, shared objects, sockets, or other means? The external process can change (HTML/JS, local, remote, native) based on what is possible.

Attached is a diagram of what we're after. The "TEXT DATA" is the pipe I would like to have. Does such a mechanism already exist?

microbit_diagram
pelikhan commented 2 years ago

Continued https://github.com/microsoft/jacdac/discussions/969