Blog posts with details:
With this software you can run an Arduino Sketch on your PC using eiher SDL or X11 on linux. It is specifically designed to test code written for any of:
If you have run code that runs on any of those 2D backends, then it will run on this linux X11/SDL backend too:
I also modified the upstream ArduinoOnPC to display on an rPi using RGBPanels thanks to this driver: https://github.com/marcmerlin/FastLED_RPIRGBPanel_GFX ArduinoOnPC is used here to run Arduino code on Raspberry Pis to take advantage of the extra CPU power, extra RAM, etc... In my specific case, it also allows displaying arduino code on the faster and more capable rpi-rgb-led-matrix RGBPanel driver.
After you run git submodules init, you will find my suite of demos from https://github.com/marcmerlin/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos
For development/Debugging, you can also run on PC using the (slow) X11 output or faster SDL output.
https://github.com/marcmerlin/ArduinoOnPc-FastLED-GFX-LEDMatrix/blob/master/examples/Makefile
is used to select X11 vs SDL rendering on linux/intel. rPi is auto detected in
https://github.com/marcmerlin/ArduinoOnPc-FastLED-GFX-LEDMatrix/blob/952bb957162238dc0ef6cbb0c3355e1c48959500/makeNativeArduino.mk#L32
In turn this affects https://github.com/marcmerlin/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos/blob/4436f8b5a71ceea4ef480f75f83b811b037c2cf6/neomatrix_config.h#L39 which will use one of the 3 available rendering backend for ArduinoOnPc.
The bundled modified FastLED library in git submodules adds an SDL driver which is then used by FastLED NeoMatrix
Please see this code to see how to use the driver:
Because the SDL driver is much faster than talking to real FastLED, the code for linux introduces a slowdown delay (LINUX_RENDERER_SDL_MAIN_DELAY) defined here: https://github.com/marcmerlin/ArduinoOnPc-FastLED-GFX-LEDMatrix/blob/19e23178f66363e95ebd818822b49fcc4ea26db7/examples/Makefile#L7
git submodules should retrieve the driver for you: https://github.com/marcmerlin/FastLED_TFTWrapper_GFX/
Please see this code to see how to use the driver. It is slower than SDL and left because it was the original option available with this code. If SDL works for you, you should use it instead:
git submodules should retrieve the driver for you: https://github.com/marcmerlin/FastLED_RPIRGBPanel_GFX
Please see this code to see how to use the driver (this is for rPi with rpi-rgb-panel):
With this software you can run an Arduino Sketch on your PC. You don't need an Arduino hardware. The focus here is mainly on TFTs connected to an Arduino.
This software is made for Linux using the X11 window manager. If you want to use it on windows the only current option is a virtual machine.
Some Arduino boards do not have a debugging possibility. To find the errors in your sketches it might be usefull to be able to use a debugger. Using this tool you can debug your program locally, and develop without having to tinker with any additional hardware.
As a reminder this fork is also meant to run Arduino code on rPi.
You need gcc and make installed.
The project uses git submodules to include some Arduino libraries. To get them, you have to run
git submodule init
git submodule update
after checking out the repository.
List of libraries imported (git submodule list)
APIs:
Drivers:
Demo code I gathered/ported/sorted by the API they use (FastLED, FastLED::NeoMatrix/Adafruit::GFX, or LEDMatrix):
If you use FastLED_RPIRGBPanel_GFX, make sure you first build rpi-rgb-led-matrix:
cd rpi-rgb-led-matrix; make
If you don't use my special rPI RGBPanel driver ( https://github.com/marcmerlin/FastLED_RPIRGBPanel_GFX ), or SDL output (better than X11 support), then this project then uses X11. Therefore you have to install X11 support, something like:
sudo apt-get install libx11-dev electric-fence
sudo pacman -Sy libx11 electric-fence
yum install libx11 electric-fence
electric-fence is optional, but recommended since it helps find buffer overruns (actually ASAN is better now, see
https://github.com/marcmerlin/ArduinoOnPc-FastLED-GFX-LEDMatrix/blob/7e248c4b5db717534a46cb57b45689a3ad847665/makeNativeArduino.mk#L1
BUG: Even if you use the RGB Panel output, compilation will likely needlessly require X11 even if the end binary will not require it.
# GFX examples that use either SDL (default on intel), X11, or RGBPanel (Default on rPi) output:
cd examples/GFX_Sublime_Demos/
examples/GFX_Sublime_Demos$ make
examples/GFX_Sublime_Demos$ ./Sublime_Demo
# Use numeric keypad + to make brighter or n/p to select demo
# Original examples that only compile with the slow X11 backend (not prefixed by GFX_):
cd examples/Adafruit_touchpaint
# Compile the code
make
# Execute
./Adafruit_touchpaint
A big plus of this code compiling and debugging your code on linux, is that you can compile with gcc ASAN, which will allow you do find memory errors easily. Read this for details: https://github.com/marcmerlin/ArduinoOnPc-FastLED-GFX-LEDMatrix/blob/master/makeNativeArduino.mk#L1