jasoncoon/esp8266-fastled-webserver

DATA_PIN undefined?

Closed this issue · 7 comments

Hi, I just pulled from the main branch, and when I try to compile the code I'm getting this error:

296 | FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_PIXELS); // for WS2812 (Neopixel) no matching function for call to 'CFastLED::addLeds<WS2811, <expression error>, RGB>(CRGB [200], int)'

Looking into it, appears that the DATA_PIN is undefined. I searched through the code and could not find any definition for it anywhere. What am I missing?

Thanks.

Hi Jack,

I just cloned to a fresh directory, opened the sketch in Arduino, and built without error.
[Update ... the fresh clone also built cleanly under PlatformIO]

Are you using PlatformIO to build?

If using Arduino, have you manually installed the required libraries (see README.md)?

I, too, scanned the config files and could not find the DATA_PIN variable in the ordinary build. I mainly use the "thing" build, but occasionally use the single pin version. Likewise, I built it with both Arduino and PlatformIO, and it compiled ok. I just want to be able to use another pin.

Thanks, Jason.

@dherkes: The easiest way to use a different data pin, when compiling in Arduino:

prior to the line #include "config.h", simply define the variable yourself:

#define DATA_PIN 4

That's it.

Details for those interested in how this all works...

Near the top of config.h, it defines a symbol starting with PRODUCT_.
This defines which product-specific configuration header file is included.
Un-comment the one for PRODUCT_ESP8266_THING for defaults for ESP Thing.

Later in config.h, those PRODUCT_xxx defines select the header file that is included. For ESP Thing, the header file is ./include/configs/product/esp8266_thing.h. The configuration in that header file is all simply defaults ... each one first checks if the symbol is already defined, before defining the default.

Therefore, this makes it really easy to override any of those defaults, for any of the products ... just define the symbol yourself before the line that includes config.h.


Perhaps I should modify config.h with some more examples on how to change stuff?

I am now using PlatformIO. I, for one, would appreciate the examples in the code.

Hi @dherkes ... check out #218 (comment).

As you can see, in PlatformIO, it's even easier.

Rather than modify any of the checked-in files, simply create the platformio_override.ini file with your own environment section, with the settings you want/need.

I'll add a comment to the top of the .ino file to help make this clearer.