Hi Hans,
I have had a chance to try the additional code, but it appears that there may be a minor error somewhere in the last entries. I have tried a few things, but whatever I do, it only seems to make things worse !
The error code I get is:
Arduino: 1.6.3 (Windows 7), Board: "Arduino Duemilanove or Diecimila, ATmega328"
Flagsweep.ino: In function 'void loop()':
Flagsweep.ino:51:1: error: 'led' was not declared in this scope
Flagsweep.ino:55:1: error: expected '}' at end of input
Error compiling.
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
The complete sketch I used, now looks as follows:
#include "FastLED.h"
// Number of RGB LEDs in the strand
#define NUM_LEDS 150
// Define the array of leds
CRGB leds[NUM_LEDS];
// Arduino pin used for Data
#define PIN 6
// Define a few colors
#define Red 0x00FF00
#define White 0xFFFFFF
#define Blue 0x0000FF
#define Green 0xFF0000
#define Black 0x000000
#define Yellow 0xFFFF00
#define Orange 0x5FF500
#define DimGray 0x050505
#define Lightblue 0xBB00AA
uint32_t flagcolors[5][30] = {
{ Red, Red, Red, Red, White, White, White, White, Blue, Blue,
Blue, Blue, Black, Red, Red, Red, Red, White, White, White,
White, Green, Green, Green, Green, Black, Red, Red, Red, Red }, // row 1
{ Yellow, Yellow, Yellow, Yellow, DimGray, DimGray, DimGray, DimGray, Black, Yellow,
Yellow, Yellow, Yellow, Red, Red, Red, Red, Yellow, Yellow, Yellow,
Yellow, Black, Blue, Blue, Blue, Blue, White, White, White, White }, // row 2
{ Red, Red, Red, Red, Black, Lightblue, Lightblue, Lightblue, Lightblue, White,
White, White, White, Lightblue, Lightblue, Lightblue, Lightblue, Black, Red,Red,
Red, Red, White, White, White, White, Lightblue, Lightblue, Lightblue, Lightblue }, // row 3
{ Black, Red, Red, Red, Red, White, White, White, White,
Red, Red, Red, Red, Black, Lightblue, Lightblue, Lightblue, Lightblue, Yellow,
Yellow, Yellow, Yellow, Lightblue, Lightblue, Lightblue, Lightblue, Black, Red, Red }, // row 4
{ Red, Red, White, White, White, White, Blue, Blue, Blue, Blue,
Black, Orange, Orange, Orange, Orange, White, White, White, White, Green,
Green, Green, Green, Red, White, Blue, Orange, Lightblue, Green, Yellow } // row 5
};
void setup()
{
FastLED.addLeds<NEOPIXEL, PIN, RGB>(leds, NUM_LEDS);
}
void loop() // this keeps repeating: draw flag colors, wait, wipe strip to black,...
{
// For setting the flag one time
for(int row = 0; row < 5; row++) {
for(int col = 0; col < 30; col++) {
leds[ (row*30)+col ] = flagcolors[row][col];
delay(100); // 0.1 second slow down
FastLED.show(); // Light up one at a time
}
delay(5000); // 5 seconds
// All LEDs OF
for(int i = NUM_LEDS-1 ; i >= 0; i-- ) {
led = 0;
FastLED.show();
delay(1); // You can remove this (instant black, or increase the delay)
}
}
Cheers,
Chris