Hi everyone, just started playing with the Fastled(3.1) library,

Hi everyone, just started playing with the Fastled(3.1) library, specifically due to the parallel output for Teensy. I’ve been using the artnet OctoWS library, but the dithering and colour correction sounds good!
I have a fairly fundamental issue, if I try and add fastLED to the artnet OctoWS example, if I try and verify I get ‘initTest’ was not declared in this scope.
This also happened when I tried the other way round and added the artnet code into the octo fastled example.
Just including the library seems to stop the setup working, is this by design, or a fault?
Any pointers appreciated!
http://www.evernote.com/l/AhdnRRrS3mJHmIDpFZrV7a2OGjoG-D8k3p0/

Move the InitTest proc up before its first reference in the code to get it “in scope”.

I thought I’d tried that, but seems not, next question is why does this behavior change on including the FastLED library?

Just in case anyone needs it, here’s a working 4 universe version, seems to fail with more than 4 at the moment, not sure why
#define USE_OCTOWS2811
#include<OctoWS2811.h>
#include<FastLED.h>
#include <Artnet.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <SPI.h>

#define NUM_LEDS_PER_STRIP 170
#define NUM_STRIPS 4

CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];

// Pin layouts on the teensy 3:
// OctoWS2811: 2,14,7,8,6,20,21,5

// Artnet settings

Artnet artnet;
const int startUniverse = 0; // CHANGE FOR YOUR SETUP most software this is 1, some software send out artnet first universe as zero.
const int numberOfChannels = NUM_LEDS_PER_STRIP * NUM_STRIPS * 3; // Total number of channels you want to receive (1 led = 3 channels)
byte channelBuffer[numberOfChannels]; // Combined universes into a single array

// Check if we got all universes
const int maxUniverses = numberOfChannels / 512 + ((numberOfChannels % 512) ? 1 : 0);
bool universesReceived[maxUniverses];
bool sendFrame = 1;

// Change ip and mac address for your setup
byte ip[] = {192, 168, 0,3};
byte mac[] = {0x04, 0xE9, 0xE9, 0x09, 0x69, 0xEC};
//------------------------------------------------------------------------------------------
void onDmxFrame(uint16_t universe, uint16_t length, uint8_t sequence, uint8_t* data)
{
sendFrame = 1;
// Store which universe has got in
if (universe < maxUniverses)
universesReceived[universe] = 1;

for (int i = 0 ; i < maxUniverses ; i++)
{
if (universesReceived[i] == 0)
{
//Serial.println(“Broke”);
sendFrame = 0;
break;
}
}

// read universe and put into the right part of the display buffer
for (int i = 0 ; i < length ; i++)
{
int bufferIndex = i + ((universe - startUniverse) * length);
if (bufferIndex < numberOfChannels) // to verify
channelBuffer[bufferIndex] = byte(data[i]);
}

// send to leds
for (int i = 0; i < NUM_LEDS_PER_STRIP * NUM_STRIPS; i++)
{
leds[i].setRGB(channelBuffer[(i) * 3], channelBuffer[(i * 3) + 1], channelBuffer[(i * 3) + 2]);
}

if (sendFrame)
{
LEDS.show();
LEDS.delay(10);
// Reset universeReceived to 0
memset(universesReceived, 0, maxUniverses);
}
}
//------------------------------------------------------------------------------------------------------------
void setup()
{
LEDS.addLeds(leds, NUM_LEDS_PER_STRIP);
// LEDS.setBrightness(64);
artnet.begin(mac, ip);
Serial.begin(115200);
// this will be called for each packet received
artnet.setArtDmxCallback(onDmxFrame);
}
//------------------------------------------------------------------------------------------------------------
void loop()
{
artnet.read();
}

Whatever is causing the change of scope behavior is also impacting some of the examples, at least for me noiseplayground fails to compile.

It’s a set of bugs in Arduino (specifically arduino-builder) - many of these were fixed in 1.6.8.

Ah thats good to know! Thanks for that!

I still get compile errors in 1.6.8, looks like more digging to do.

It would help if you turned on verbose compiler output in arduino (go into preferences, and select the checkbox for “Show verbose output during compilation”) and uploaded the entire build log (to pastebin or gist) so that I (or others here) can see what’s going wrong.

Also, it’s important that you fill in what platform you’re compiling for (because some of these arduino IDE errors occurred with some targets, but not with others).

(Note: NoisePlayground + arduino 1.6.8 is compiling without any problems here)

(See also http://fastled.io/faq )