This is a little simulator that allows quicker development iteration on Python code.
It's a (C)Python application which sets up its environment so that it appears similar enough to the Badge's micropython environment.
All C-implemented functions are implemented (or maybe just stubbed out) by 'fakes' in the fakes directory. Please try to keep this in sync with the real usermodule implementation.
Of particular interest is how we provide a ctx
-compatible API: we compile it using emscripten to a WebAssembly bundle, which we then execute using wasmer.
You need Python3.10 and Pipenv installed.
Run:
pipenv install
From the main firmware code:
cd sim
pipenv run python run.py
Try using non-precompiled Python.
Try using Python 3.9 as suggested in this issue:
pipenv shell
pip3.9 install wasmer wasmer_compiler_cranelift pygame
python3.9 run.py
No support for most things.
Thank you to the flow3r team, whose simulator this is forked from.