Skip to content

Allow FastLED::NeoMatrix/SmartMatrix::GFX/Framebuffer::GFX/LEDMatrix code to run on Linux/SDL

Notifications You must be signed in to change notification settings

MarcFork/FastLEDonPc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastLED on PC

Obsolete

This is replaced by the more up to date and more complete https://github.com/marcmerlin/ArduinoOnPc-FastLED-GFX-LEDMatrix

What?

With this software you can run an Arduino Sketch on your PC and is specifically designed to test code written for any of:

If you have run code that runs on any of:

102_demo_snaps 103_demo_snaps

Why?

Ben's original answer:
It takes three weeks to ship a serial LED strip from China, but I want to start coding animations now!

Marc's new answer:

  • Complicated code can take a while to write and debug, and it's just much faster on a PC than actual hardware.
  • It also makes it easier to test code to see whether it works on resolutions like 320x240 if you don't have capable hardware like ILI9341 supported by https://github.com/marcmerlin/FastLED_SPITFT_GFX
  • You can work on your demo code while travelling and without having to carry bigger matrix displays

HowTo

If you are using Arduino Make, it should be sufficient to replace the Arduino.mk include with makeNativeArduino.mk in your Makefile. Then simply run make as usual. This uses a patched version of FastLED which outputs to a SDL buffer instead of real hardware.

If things appear too dark, use the + key to increase brightness.

See the example/ directory for examples.

If you use FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos, you can simply use neomatrix_config.h and it will set everything up for you.

If you want to do it manually like in example/hello_world:

FastLED.addLeds<WS2812B, DATA_PIN>(leds, num_leds);   # before
FastLED.addLeds<SDL, width, height>(leds, num_leds);  # after

The Layout for NeoMatrix is NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS (no ZIGZAG as you would want on real hardware).

Installation

SDL is used to render a simulation of the LED-Strip Matrix. To install the required dependencies, run

sudo apt install libsdl2-dev

The project uses git submodules to include the Arduino libraries. To get them, you have to run

git submodule init
git submodule update

after checking out the repository.

About

Allow FastLED::NeoMatrix/SmartMatrix::GFX/Framebuffer::GFX/LEDMatrix code to run on Linux/SDL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 69.9%
  • C 27.8%
  • Makefile 2.3%