Wokwi is a platform that helps you design and run Ardunio in the cloud (free for Open Source projects).
To run it locally, the following steps can be used :
- Install VSCode
Ctrl Shift X- Install the Wokwi Simulator extension
Ctrl Shift PWokwi: Request a New License- Install the Wokwi license (free for trial period)
- Install the Arduino CLI
- Install the Arduino model (Arduino UNO in my case):
arduino-cli.exe core install arduino:avr - If needed, rename the .ino file (eg: sketch.ino ) to
foldername.ino - Install additional needed libraries. Eg for Servo :
arduino-cli.exe lib install servo - Compile the local project :
arduino-cli.exe compile -e --fqbn arduino:avr:uno - Compiling generates a build folder containing.
- arduino.avr.uno
- .ino.eep
- .ino.elf
- .ino.hex
- .ino.with_bootloader.bin
- .ino.with_bootloader.hex
- arduino.avr.uno
-
Create wokwi.toml file with the following content
[wokwi] version=1 firmware='build/arduino.avr.uno/<projectname>.ino.hex' firmwaremust have the local path to the.ino.hexfile. Use forward slashes even for Windows.Open the local project in VSCode as a folder, if you haven't already
Ctrl Shift PWokwi: Start SimulatorAfter each change to the .ino (C++ code), it's enough to recomplile.
The simulator will reflect the changes, without being restarted.