I have been googling and searhcing my butt off.

i am using “FastSPI_LED2.h”

here is what i am currently using that is turning them all white and then does nothing else.

#include “FastSPI_LED2.h”
#define NUM_LEDS 25
#define DATA_PIN 0

// This is an array of leds. One item for each led in your strip.
CRGB leds[NUM_LEDS];

void setup() {

  // FastSPI_LED2.addLeds<WS2811, DATA_PIN, GRB>(leds+18, NUM_LEDS/3);
  // FastLED.addLeds<WS2811, 8, RGB>(leds + 225, NUM_LEDS/4);
  FastLED.addLeds<WS2811_400, DATA_PIN, RGB>(leds, NUM_LEDS);

}

// This function runs over and over, and is where you do the magic to light
// your leds.
void loop() {
// Move a single white led
for(int whiteLed = 1; whiteLed < NUM_LEDS; whiteLed = whiteLed + 1) {
// Turn our current led on to white, then show the leds
leds[whiteLed] = CRGB::Red;

  // Show the leds (only one of which is set to white, from above)
  FastLED.show();

  // Wait a little bit
  delay(100);

  // Turn our current led back to black for the next loop around
  leds[whiteLed] = CRGB::Black;

}
}

i honestly thought i was going to need struct CRGB *leds; or some other variation of the struct command

That doesn’t tell me the version that you downloaded - we’ve been pushing new versions to the site regularly as we’ve been making bug fixes leading up to a release - what version did you download? (They all include FastSPI_LED2.h)

Again - you are adding leds for WS2811_400 - most of the WS2811’s out there are not the 400khz variety - have you tried replacing WS2811_400 with WS2811?

CRGB leds[NUM_LEDS]; is what sets up the array of leds - struct isn’t a command, it’s part of a typename - e.g. “struct CRGB” means “the structure named CRGB” (for historical reasons - in older versions of C this was used to make it clear that you were talking about the name of a struct vs. some other type or variable name - sometimes that convention sticks around).

Specifically, re: my comment above - change the line that says:

  FastLED.addLeds<WS2811_400, DATA_PIN, RGB>(leds, NUM_LEDS);

to

  FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);

ok removed _400. they are all still just changing white. As far as I read the code shouldn’t this just be turning on one led at a time and then advancing?

#include “FastSPI_LED2.h”
#define NUM_LEDS 25
#define DATA_PIN 0

CRGB leds[NUM_LEDS];

void setup() {

  FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);

}

void loop() {
// Move a single white led
for(int whiteLed = 1; whiteLed < NUM_LEDS; whiteLed = whiteLed + 1) {
// Turn our current led on to white, then show the leds
leds[whiteLed] = CRGB::White;

  // Show the leds (only one of which is set to white, from above)
  FastLED.show();

  // Wait a little bit
  delay(100);

  // Turn our current led back to black for the next loop around
  leds[whiteLed] = CRGB::Black;

}
}

Yup - have you tried the other pins? Also are you running the trinket at 8Mhz or 16Mhz? When @Mark_Kriegsman was getting stuff up and running with the Trinket, I remember that he had to do something odd with the clock.

According to http://learn.adafruit.com/introducing-trinket/16mhz-vs-8mhz-clock - if your’e trying to run the trinket at 16Mhz, then you need to add this line to the beginning of setup:

if (F_CPU == 16000000) clock_prescale_set(clock_div_1);

It’s pretty important that the value of F_CPU line up with the clock speed that you’re running at, as F_CPU is how I determine the timings for the WS2811 :slight_smile:

One other question - is the trinket that you have 3.3v or 5v, and what is the power supply that you are using?

I have the newest fastspi_led2

using 5v walwart @5v been running at 16mhz. will try 8

I heart you! changing to 8mhz did the trick.

Ok - or if you stay at 16 put that line of code in.

Excellent! I’ll have to put some notes together for the trinket and 16Mhz

Glad it’s up and running. The Trinket and the Gemma are definitely not (yet?) up to the same plug-and-play level as boards like the Uno or Leonardo. I think I’m going to recommend that people not use Trinket or Gemma for their first LED project. They’re great for wearables – but they still have too many ‘underdocumented’ pitfalls. Sorry everyone wasted time on this tonight, but I’m glad it got up and running after all.

one thing the first light in the string is not turning on during the run

Sometimes that can be fixed by wiring the end of the data line (eg at the far end of the strip) to ground. It’s an electrical glitch.

Try

FastLED.showColor( CRGB::White );
delay( 10000);

that should turn them all on white for ten seconds and you can tell if there’s a dead LED, or if there’s just something wrong with the code that’s lighting it up. If a dead LED, at least you know. If the LEDs all light up, then you know it’s just a software bug and you can work on it as usual!

they all work if i turn them all on at once with
FastLED.showColor( CRGB::White );

oh! There’s a typo in your array code :slight_smile:

the “int whiteLed = 1;” should be “int whiteLed = 0;” – by saying “= 1” you’re starting from the second, not the first led (arrays in C start counting at 0)

Perfect. How do I fade. I thought I saw a brightness command.