- 博客(0)
- 资源 (4)
- 收藏
- 关注
WS2812FX-master.zip
WS2812控制LED灯程序库
#include "FastLED.h" // be sure to install and include the FastLED lib
#include
#define NUM_LEDS 30
#define LED_PIN 5
WS2812FX ws2812fx = WS2812FX(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);
// declare global parameters used by Fire2012
bool gReverseDirection = false;
void setup() {
Serial.begin(115200);
// init WS2812FX to use a custom effect
ws2812fx.init();
ws2812fx.setBrightness(255);
ws2812fx.setColor(BLUE);
ws2812fx.setSpeed(1000);
ws2812fx.setMode(FX_MODE_CUSTOM);
ws2812fx.setCustomMode(myCustomEffect);
ws2812fx.start();
}
void loop() {
ws2812fx.service();
}
// in the custom effect run the Fire2012 algorithm
uint16_t myCustomEffect() {
Fire2012();
// return the animation speed based on the ws2812fx speed setting
return (ws2812fx.getSpeed() / NUM_LEDS);
}
2020-02-26
[程序员突击Visual.Csharp.2008原理与系统开发].欧阳炜昊.扫描版.pdf
[程序员突击Visual.Csharp.2008原理与系统开发].欧阳炜昊.扫描版.pdf
2018-09-19
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人