i need my arduino to do multi-tasks , that's why i need the fastled delay with millis()
here is my code(actully its an example from fastled lol)
#include<FastLED.h>
#define NUM_LEDS 64
float brightness;
int LED_R = 1;//RGB value of LED --by Jason
int LED_G = 1;
int LED_B = 1;
int LED_ID;
CRGBArray<NUM_LEDS> leds;
void setup() {
FastLED.addLeds<NEOPIXEL,6>(leds, NUM_LEDS);
pinMode(0,OUTPUT);
pinMode(1,INPUT);
digitalWrite(0,HIGH);
}
void loop(){
static uint8_t hue;
for(int i = 0; i < NUM_LEDS/2; i++) {
// fade everything out
leds.fadeToBlackBy(40);
if(digitalRead(1) == LOW) {
brightness = 0;
}
if(digitalRead(1) == HIGH) {
brightness = 0.1;
}
// let's set an led value
leds[i] = CRGB(255*brightness,255*brightness,0*brightness);
// now, let's first 20 leds to the top 20 leds,
leds(NUM_LEDS/2,NUM_LEDS-1) = leds(NUM_LEDS/2 - 1 ,0);
FastLED.delay(33);//here is where i want to use millis()
}
}