Sim I/O or console data to-and-from external JS process, in real time #969
Replies: 1 comment 8 replies
-
Jacdac uses a mechanism called "control simmessages" in pxt that allows to send a buffer through a C++ function or through a HTML window message (to/from jacdac simulator iframe). The API is implemented in pxt however loading iframes in the editor is restricted to known URLs, so you would have to create a local build of the editor to allow yours. That being said, it may turn out that Jacdac is the right abstraction for you and we can make it work for your scenario. We already support a switching between simulated or hardware data in the micro:bit editor. I'm wondering what's the gap to make it useful in your scenario. (Note I'm confused about the difference of both workflows) |
Beta Was this translation helpful? Give feedback.
-
After asking around on the regular makecode lists, I've been directed here in case someone hopefully knows how to achieve this: pipe makecode/microbit sim data in real time to another JS workflow (via ANY method, such as classic JS console or maybe a socket), and then have that other workflow also send back data (via simulated sensors, for example) to the makecode sim. The other workflow would be a real time processor of the sim data, written also in JavaScript and perhaps in another HTML frame, and pass back state for the simulated microbit to handle. Please advise!
Beta Was this translation helpful? Give feedback.
All reactions