Repository navigation
Closed
Milestone
Description
I'm not very familiar with github, but I noticed that the example "testleds" was still relying on FastSPI_LED, so I updated the code ... I know this is not the way to do it, I just don't know the right way to contribute ... hopefully it's helpful ...
--- example code "testleds" ---
#include "FastLED.h"
#define NUM_LEDS 60
// Define the array of leds
CRGB leds[NUM_LEDS];
#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);
switch(j) {
case 0: leds[i].r = 255; break;
case 1: leds[i].g = 255; break;
case 2: leds[i].b = 255; break;
}
FastLED.show();
delay(10);
}
}
// growing/receeding bars
for(int j = 0; j < 3; j++) {
memset(leds, 0, NUM_LEDS * 3);
for(int i = 0 ; i < NUM_LEDS; i++ ) {
switch(j) {
case 0: leds[i].r = 255; break;
case 1: leds[i].g = 255; break;
case 2: leds[i].b = 255; break;
}
FastLED.show();
delay(10);
}
for(int i = NUM_LEDS-1 ; i >= 0; i-- ) {
switch(j) {
case 0: leds[i].r = 0; break;
case 1: leds[i].g = 0; break;
case 2: leds[i].b = 0; break;
}
FastSPI_LED.show();
delay(1);
}
}
// Fade in/fade out
for(int j = 0; j < 3; j++ ) {
memset(leds, 0, NUM_LEDS * 3);
for(int k = 0; k < 256; k++) {
for(int i = 0; i < NUM_LEDS; i++ ) {
switch(j) {
case 0: leds[i].r = k; break;
case 1: leds[i].g = k; break;
case 2: leds[i].b = k; break;
}
}
FastLED.show();
delay(3);
}
for(int k = 255; k >= 0; k--) {
for(int i = 0; i < NUM_LEDS; i++ ) {
switch(j) {
case 0: leds[i].r = k; break;
case 1: leds[i].g = k; break;
case 2: leds[i].b = k; break;
}
}
FastLED.show();
delay(3);
}
}
}Metadata
Metadata
Assignees
Labels
No labels
Activity
focalintent commentedon Jan 3, 2014
Actually, it shouldn’t even be in there at all - i’ll remove the test case. It’s an accidental checking.
—Dg
On Jan 3, 2014, at 2:48 PM, Hansaplast [email protected] wrote:
Hansaplast commentedon Jan 3, 2014
OK, no problem 👍