Created
July 3, 2020 03:43
-
-
Save erichowey/7631a54fb6ecd386ac22e901e91aa608 to your computer and use it in GitHub Desktop.
Multiple CRGB Instances
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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