You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • As @Wilberforce says, there's a proper Linux build of Espruino (I haven't tried for Mac, but it shouldn't be too hard to compile). It has a Telnet server too so you can push code to it straight from the CLI tools.

    Making a full JS emulator is cool, but it'll be a lot of work to implement the full API in a way that behaves exactly the same - it might be easier to start with an actual Espruino build and then work on implementing the hardware emulation.

    By default it accesses pins exposed via the filesystem (eg. if you're on a Pi), but you could tweak that quite easily so that you could interface it to your hardware emulator. In fact as you're working in JS you could look at compiling Espruino with Emscripten - you could then hook onto the actual GPIO implementation with JavaScript. It'd also be a lot easier to port to the browser if you needed :)

    I'm kind of surprised there isn't a library of emulated hardware already that could be used somehow, even if it were made for Arduino. You could do all kinds of fun stuff like hooking into real hardware using sigrok and then using an emulated LCD (for example) to debug.

About

Avatar for Gordon @Gordon started