A web-based simulator for the OpenCalc calculator, running the actual firmware compiled to WebAssembly.
- Node.js (v18+)
- Emscripten SDK for compiling firmware to WASM
- Install Emscripten SDK:
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest- Activate Emscripten in your shell:
source ~/emsdk/emsdk_env.sh- From the repository root, run the build script:
./firmware/wasm/build_wasm.shThis generates:
web-sim/src/wasm/opencalc.jsweb-sim/src/wasm/opencalc.wasm
cd web-sim
npm install
npm run devThen open the URL shown by Vite (usually http://localhost:5173).
web-sim/
├── src/
│ ├── App.jsx # Main React component
│ ├── styles.css # Calculator styling
│ ├── main.jsx # Entry point
│ └── wasm/ # Compiled WASM files
├── public/
│ └── logo.png # Splash screen logo
└── package.json
- Splash screen with OpenCalc logo on startup
- Interactive calculator buttons
- Keyboard support
- Real-time firmware rendering via WASM
This web simulator was developed with assistance from Claude (Anthropic).