parent
f4fbb400d1
commit
07851fafce
|
@ -0,0 +1,39 @@
|
|||
#include <FastLED.h>
|
||||
|
||||
#define NUM_LEDS 300
|
||||
#define DATA_PIN 23
|
||||
#define CLOCK_PIN 18
|
||||
|
||||
CRGB leds[NUM_LEDS];
|
||||
|
||||
long startTime = 0;
|
||||
long endTime = 0;
|
||||
long ttotaltiem = 0;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, GRB>(leds, NUM_LEDS);
|
||||
FastLED.setBrightness(100);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
startTime = millis();
|
||||
leds[0] = CRGB::Black;
|
||||
|
||||
|
||||
for(int i = 0; i< NUM_LEDS; i++){
|
||||
leds[i] = CRGB::White;
|
||||
FastLED.show();
|
||||
delayMicroseconds(1);
|
||||
leds[i] = CRGB::Black;
|
||||
}
|
||||
|
||||
endTime = millis();
|
||||
ttotaltiem = endTime-startTime;
|
||||
|
||||
// Output in CSV format
|
||||
Serial.print(testCount);
|
||||
Serial.print(",");
|
||||
Serial.println(totalTime);
|
||||
|
||||
}
|
Loading…
Reference in New Issue