说是火焰的感觉,下面红上面白,而且可以变化,也没啥太多可以说的
/// @file Fire2012.ino
/// @brief Simple one-dimensional fire animation
/// @example Fire2012.ino
#include <FastLED.h>
#define LED_PIN 2
#define COLOR_ORDER GRB
#define CHIPSET WS2812B
#define NUM_LEDS 100
#define BRIGHTNESS 200
#define FRAMES_PER_SECOND 60
bool gReverseDirection = false;
CRGB leds[NUM_LEDS];
void setup() {
delay(3000); // sanity delay
FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, 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(); // run simulation frame
FastLED.show(); // display this frame
FastLED.delay(1000 / FRAMES_PER_SECOND);
}
// Fire2012 by Mark Kriegsman, July 2012
// as part of "Five Elements" shown here: http://youtu.be/knWiGsmgycY
////
// This basic one-dimensional