Skip to content

Instantly share code, notes, and snippets.

@erichowey
Created July 3, 2020 03:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erichowey/7631a54fb6ecd386ac22e901e91aa608 to your computer and use it in GitHub Desktop.
Save erichowey/7631a54fb6ecd386ac22e901e91aa608 to your computer and use it in GitHub Desktop.
Multiple CRGB Instances
#include <FastLED.h>
#define LEFT_LED_PIN 22
#define RIGHT_LED_PIN 23
#define LEFT_NUM_LEDS 72
#define RIGHT_NUM_LEDS 72
CRGB leftLEDS[NUM_LEDS];
CRGB rightLEDS[NUM_LEDS];
...
void setup() {
delay(3000); // sanity delay
FastLED.addLeds<CHIPSET, LEFT_LED_PIN, COLOR_ORDER>(leftLEDS, LEFT_NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.addLeds<CHIPSET, RIGHT_LED_PIN, COLOR_ORDER>(rightLEDS, RIGHT_NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.setBrightness( BRIGHTNESS );
}
void loop()
{
// Add entropy to random number generator; we use a lot of it.
// random16_add_entropy( random());
Fire2012(leftLEDS); // run simulation frame
Fire2012(rightLEDS); // run simulation frame
FastLED.show(); // display this frame
FastLED.delay(1000 / FRAMES_PER_SECOND);
}
...
void Fire2012(CRGB thisleds)
{
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment