对应于arduino中的fastled库中的ColorTemperature例子,没啥好说的,也没啥算法,简单就可以理解。
例子一段时间显示A色温,然后黑一段,再显示B色温,通过第一个led的颜色来标识当前是什么色温。当然里面的fill_rainbow函数值得分析,稍后移植到stm32的时候会进行分析。
/// @file ColorTemperature.ino
/// @brief Demonstrates how to use @ref ColorTemperature based color correction
/// @example ColorTemperature.ino
#include <FastLED.h>
#define LED_PIN 2
// Information about the LED strip itself
#define NUM_LEDS 108
#define CHIPSET WS2812B
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
#define BRIGHTNESS 128
// FastLED provides two color-management controls:
// (1) color correction settings for each LED strip, and
// (2) master control of the overall output 'color temperature'
//
// THIS EXAMPLE demonstrates the second, "color temperature" control.
// It shows a simple rainbow animation first with one temperature profile,
// and a few seconds later, with a different temp