Ardupysimq: Transparent Arduino simulator (C++/Python)
Compile and execute your Arduino C/C++ sketches on a standard desktop build environment and visualize/interact with the inputs/outputs (analog, digital, serial, filesystem) in a graphical terminal interface powered by Python.
Only minimal changes on the C++ code are required (a Makefile and the inclusion of a library). The communication between the simulator and the Arduino code is handled transparently using zeromq.
- Supported functions: Serial communication, SD filesystem read/write, digital and analog read/write, Tones (PWM), Watchdog timers.
- Specific modules: Serial LCD, Button (digital input), Relay (digital output), Sensor (analog input), Buzzer (analog output).
Adapt and compile your Arduino C++ code
ArduinoSim.h header file, plus those of the modules you would like to use:
#include <ArduinoSim.h> // Optional: #include <SDSim.h> #include <LCD.h> #include <Buzzer.h> #include <Button.h> #include <Relay.h> #include <ParallaxRFID.h> #include <MFRC522RFID.h>
By passing the flag
SIMULATORand linking the library
ArduinoSim (plus those of the modules you would like to use), you can now compile your Arduino sketch on your desktop. Moreover, the code can still be compiled for Arduino.
Edit and launch the simulator
Launch the simulator with (sudo is required so that zmq can bind a socket):
$ sudo python -m main
Launch the Arduino sketch
You should now be able to visualize and interact with inputs and outputs on the simulator.