fakeduino: Testing Arduino sketches on the desktop#

Firmware development

Developing with the Arduino IDE is usually a breeze… for simple stuff. You want to create a 200-line sketch that reads some sensors and does something very specific, and self contained? It’s fine. Things are not so nice when trying to implement something more complex. Why?

  1. Uploading the sketch over and over gets boring and time-consuming;

  2. Dealing with fiddly breadboards and prototype setups is a drag when hardware is not the focus of your current task. Things can get shifted around, lose contact, or break;

  3. The Arduino IDE is not very friendly for large projects. There is no code model, version control integration, and many other features one expects from an IDE when working on a larger project.

I did not want to test every single thing of my project dealing with a board that was in flux, and as it was on a breadboard, in a delicate state. And this is exactly the kind of situation that prompts the creation of solutions such as this. Presenting fakeduino, a desktop implementation of the Arduino API. It allows the user to test applications without real hardware, working with simulacra of a character LCD screen, a DHT sensor, a serial port connection (interfacing with real hardware, includes a serial monitor), EEPROM, RTC, tone() buzzers, and the basic stuff such as delays.

Not everything is implemented, though. A good system for representing GPIOs and the stuff connected to them is sorely needed. If one takes care of abstracting away the peripherals in terms of devices and providing facades as UI elements, that should cover this need. This covers my needs, and I will be improving the implementation as more stuff is needed.

I would appreciate a heads up from anyone using this, and patches with improvements. It depends on Qt 5 and CMake. The code is available here.