描述:
RGB灯带WS2812B用arduino板控制一路颜色程序怎么写???比如我要控制它全部显示白色,之后中间接受到一个信号灯带闪烁3秒继续保持白色不变。。。反正只要接受到一个闪烁的信号就闪烁三秒,其它时间都保持白色不变。我改了程序灯带还是一直在各种颜色中间变换闪烁。。求大神赐教程序怎么写?????
#include "FastLED.h"
// Number of RGB LEDs in the strand
#define NUM_LEDS 74
// Define the array of leds
CRGB leds[NUM_LEDS];
// Arduino pin used for Data
#define PIN 6
void setup()
{
FastLED.addLeds<NEOPIXEL, PIN, RGB>(leds, NUM_LEDS);
}
void loop() {
// one at a time
// for(int j = 0; j < 3; j++)
for(int i = 0 ; i < NUM_LEDS; i++ ) {
memset(leds, 0, NUM_LEDS * 3);
// if(j)
leds[i].r = 255;
leds[i].g = 255;
leds[i].b = 255;
}
FastLED.show();
}
急急急。。。。。。。。