Hey there!
I have already posted this in the Update on Library support (eg FastLED) as it seemed appropriate, but haven’t got any response yet, so sorry for the re-post!
I have been waiting to play with FastLED and the spark core for a long time now, and i am really happy to see that the library has been ported!! So now i’m trying to build locally with NetBeans, but i keep running in to some obstacles and now i need some help moving forward.
I have just installed NetBeans again following Elco ans seulater’s tutorials (THIS) except i’m not using ST-Link to flash, and i am using the feature/HAL branch.
First of all “all warnings being treated as errors” is set, but not form the makefile. I have been looking to see if the “CFLAGS -Wno-error” is being set elsewhere but haven’t accomplished to do so. So i tried to set “-Wno-error” in the makefile, but it does not have any affect… Any idea why i am getting all warnings as errors, can it have anything to do with the Spark-CLI?
The reason i am getting an warning in the first place, is the way that FastLED is showing its version number in a warning, so I tried to just out comment that warning out in the code (the easy-fix… apparently!) but now I am getting new errors…
Building firmware for Spark core, platform ID: 0
text data bss dec hex filename
12936 632 3564 17132 42ec ../build/target/bootloader/platform-0/bootloader.elf
../build/target/main/platform-0/src/application.o: In function `addLeds<(NSFastLED::ESPIChipsets)0u, 1u, 0u, (NSFastLED::EOrder)66u>':
C:\Repos\spark-firmware\main/./libraries/FastLED/firmware/FastLED.h:191: undefined reference to `NSFastLED::CLEDController::m_pHead'
C:\Repos\spark-firmware\main/./libraries/FastLED/firmware/FastLED.h:191: undefined reference to `NSFastLED::CLEDController::m_pTail'
C:\Repos\spark-firmware\main/./libraries/FastLED/firmware/FastLED.h:191: undefined reference to `NSFastLED::CFastLED::addLeds(NSFastLED::CLEDController*, NSFastLED::CRGB*, int, int)'
../build/target/main/platform-0/src/application.o: In function `NSFastLED::CFastLED::showColor(NSFastLED::CRGB const&)':
C:\Repos\spark-firmware\main/./libraries/FastLED/firmware/FastLED.h:399: undefined reference to `NSFastLED::CFastLED::showColor(NSFastLED::CRGB const&, unsigned char)'
../build/target/main/platform-0/src/application.o: In function `loop':
C:\Repos\spark-firmware\main/src/application.cpp:25: undefined reference to `NSFastLED::FastLED'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [../build/target/main/platform-0/main.elf] Fejl 1
make: *** [main] Fejl 2
BUILD FAILED (exit value 2, total time: 7s)
I have placed the library in the library folder and included it like this “libraries/FastLED/firmware/FastLED.h”
Here is my simple code
//#pragma SPARK_NO_PREPROCESSOR
#include "application.h"
#include "libraries/FastLED/firmware/FastLED.h"
FASTLED_USING_NAMESPACE;
SYSTEM_MODE(SEMI_AUTOMATIC);
#define NUM_LEDS 160
#define DATA_PIN D1
#define CLOCK_PIN D0
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
FastLED.showColor(CRGB::Green);
}
Why am i getting those errors, have i implemented the library in a wrong way? Should i add anything to the makefile?
Also I wondered what is the best way to handle different libraries and multiply projects(application.cpp’s and other files) in NetBeans? Should i follow the uber library guide and just add them into the libraries folder and how can i choose witch project should get compile, in best meaner? I have looked around to see i someone have done something similar, but haven’t got a real breakthrough yet.
Thanks!