Skip to content

Instantly share code, notes, and snippets.

@StefanPetrick
StefanPetrick / 2animations.ino
Last active August 17, 2023 17:10
Simple example of a video cross fade
#include "FastLED.h"
#define NUM_LEDS 144
// have 3 independent CRGBs - 2 for the sources and one for the output
CRGB leds[NUM_LEDS];
CRGB leds2[NUM_LEDS];
CRGB leds3[NUM_LEDS];
void setup() {
@StefanPetrick
StefanPetrick / noise_noise.ino
Last active September 11, 2023 14:05
FastLED simplex noise and colormapping fully modulated by itself
void noise_noise1() {
CRGBPalette16 Pal( pit );
/* here is how the palette looks like:
DEFINE_GRADIENT_PALETTE( pit ) {
0, 3, 3, 3,
64, 13, 13, 255, // blue
128, 3, 3, 3,
192, 255, 130, 3, // orange
@StefanPetrick
StefanPetrick / Fire2018-2.ino
Last active December 8, 2023 02:44
Fire effect v2.0 for FastLED matrix
#include "FastLED.h"
// matrix size
uint8_t Width = 16;
uint8_t Height = 16;
uint8_t CentreX = (Width / 2) - 1;
uint8_t CentreY = (Height / 2) - 1;
// NUM_LEDS = Width * Height
#define NUM_LEDS 256
/*
FastLED Fire 2018 by Stefan Petrick
The visual effect highly depends on the framerate.
In the Youtube video it runs at arround 70 fps.
https://www.youtube.com/watch?v=SWMu-a9pbyk
The heatmap movement is independend from the framerate.
The actual scaling operation is not.
@StefanPetrick
StefanPetrick / basic_render_engine_v01
Last active December 8, 2023 02:50
Demo code for Stefans FastLED tutorial #2. It's a 2d render engine for procedural animations v0.1
// Polar basics demo for the
// FastLED Podcast #2
// https://www.youtube.com/watch?v=KKjFRZFBUrQ
//
// VO.1 preview version
// by Stefan Petrick 2023
// This code is licenced under a
// Creative Commons Attribution
// License CC BY-NC 3.0
@StefanPetrick
StefanPetrick / noise_noise.ino
Last active December 18, 2023 18:22
The complete code for the noise controlled noise.
/*
A FastLED matrix example:
A simplex noise field fully modulated and controlled by itself
written by
Stefan Petrick 2017
Do with it whatever you like and show your results to the FastLED community
https://plus.google.com/communities/109127054924227823508
*/
#include "FastLED.h"
@StefanPetrick
StefanPetrick / circular_matrix.ino
Last active March 25, 2024 04:07
A 2d matrix mapped onto a circular led setup
/*
* A FastLED example showing how to
* map a virtual 2d matrix onto a circular led setup
*
* limitations: works so far only up to 255 leds
*
* written by Stefan Petrick 2016
*/
#include "FastLED.h"