Oh, Wokwi! Where have you been all my life? Or at least where were you a few years ago when I was working on Arduino projects?
I initially started using this Sub-Etha Software blog for Arduino projects. I did crazy things like porting a Color BASIC program to Arduino C, and fun things like figuring out how to write Pac-Man using the Arduio TVOut library. Eventually, I merged my interests in the old Radio Shack Color Computer (CoCo) with Arduino (and ESP8266/ESP32) and experimented with a serial port sound player and WiFi modem.
So … many … wires.
At the time, I was hoping to find some kind of Arduino emulator so I could write and test code without hooking up hardware. I found nothing.
But that seems to have changed. I just learned about Wokwi which allows one to “simulate IoT projects in your browser.” In a nutshell, it’s a website that has a code editor (which appears to be Microsoft Visual Studio Code), compiler, and virtual target hardware like Arduino and ESP32 devices. It even supports some add-on hardware, like buttons, LCD displays, LEDs and more.
Here’s a project someone made that simulates an Arduino hooked to a numeric keypad and LCD display:
And you can build and run it right there!
There is a library of devices that are supported, and you can add them to your project and wire them up to the computer’s I/O pins. For example, as I write this blog post, I opened up a starter project that is an Arduino and a two-line LCD display. I then added a pushbutton to it.
I could then move the button to where I wanted it, then click on the connectors and draw wire lines between it and I/O pins on the Arduino. By hooking one side to an I/O pin, and the other to ground, I could then modify the program to read that button and, for this example, increment a counter while the button is being held done.
It’s just that easy! I had no idea!
The files can be downloaded and used on real hardware, or you can make an account and log back in to continue working on them. (It has an unusual way to log in — it sends you an e-mail and you click a link to log in, rather than having a username and password. This seems to mean I cannot log in from any system that I don’t have my e-mail account configured on, but I do see options for using a Google or Github login.)
I hope you find this as useful as I already have.
Happy coding!