I can’t seem to get even the basic “blink” to run on my Uno.
Here is the code I’m using, when I try to compile I get this error:
In file included from /Users/philspitler/Dropbox/Current_Projects/PoV/Arduino/Blink/Blink.ino:1:0:
/Users/philspitler/Documents/Arduino/libraries/FastLED/FastLED.h:12:2: warning: #warning FastLED version 3.001.000 (Not really a warning, just telling you here.) [-Wcpp] #warning FastLED version 3.001.000 (Not really a warning, just telling you here.)
^
If I use the Adafruit DotStar library, I can get the strand illuminated so I know the wiring is correct.
I’m sure it’s something simple.
Any advice?
Cheers.
Phil
#include “FastLED.h”
#define NUM_LEDS 12
#define DATA_PIN 11 #define CLOCK_PIN 13
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<DOTSTAR, RGB>(leds, NUM_LEDS);
}
void loop() {
// Turn the LED on, then pause
leds[0] = CRGB::Red;
FastLED.show();
delay(500);
// Now turn the LED off, then pause
leds[0] = CRGB::Black;
FastLED.show();
delay(500);
}
Hmmm. Try deleting the FastLED library you have and get the latest (which should report version 3.001.005)
Also, maybe try using this addLeds line instead your current one. It must be the same under the hood, but I’ve always explicitly spelled it out in the addLeds line.
FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
Also, make sure you don’t have a duplicate of the library somewhere else as that’s bad.
Yeah - definitely get a more recent version of the library - also that message is a warning not an error (even says that in there — later versions switch that to pragma message but the arduino ide still incorrectly marks it red in the ide.
I just deleted the old library and downloaded the latest.
The error I now get is:
The sketch does upload but no sign of life from my LED strip. If I run the Adafruit dotstar tests file, on the same hardware it works great.
Any other thoughts?
Cheers.
Phil
In file included from /Users/philspitler/Dropbox/Current_Projects/PoV/Arduino/Blink/Blink.ino:1:0:
/Users/philspitler/Documents/Arduino/libraries/FastLED-3.1.6/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.006
void loop() {
// Turn the LED on, then pause
leds[0] = CRGB::Red;
FastLED.show();
delay(500);
// Now turn the LED off, then pause
leds[0] = CRGB::Black;
FastLED.show();
delay(500);
}
(Again that is not an error - it’s a message - so I can tell what version of the library you are using). What version of arduino are you using? Also can you turn on verbose compiler output and dump the full build log into a gist, I want to see what compiler defines are being set. Also, definitely using an uno - or a clone, and if a clone, which one?
Also another thing you can try in the meantime is putting this line at the top of the ino file (it forces using software spi — which should get around a possible thing that is happening where the PIN numbers you are using and the board definitions for the hardware spi pins are not lining up):
It’s been years since I’ve tried an R3 — i wonder if something changed in the defines generated by the arduino IDE and includes that’s causing the wrong pin mapping to be used (for performance reasons, I do my own PIN number to port mappings at compile time) — I’ll try to dig one up here and see if i can figure out what’s going on.
Most of the AVR stuff that most people are using are 32u4’s and folks using the mega form factor have moved to the due, so some of this might be a bit stale.
Again - the orange message is something I put in the library to print out its version number - the arruino ide is incorrectly marking that line as red - when it is just an informational message.
Wired up a mega2560 with your code up there, and when I use pin 11 for clock and 13 for data - i get a blinking blue led - if I switch over to pins 51 and 52 for hardware SPI, I get a blinking blue led - and if I add the FASTLED_FORCE_SOFTWARE_SPI line, I still get a blinking blue led on the first one. Double checked the output with a scope as well on the sets of pins - i’m not sure what’s happening with your mega there. I still haven’t found any of my old unos, so I haven’t been able to test on that yet - and i’ve got Arduino 1.8.3 (just installed today) on macOS 10.12 - what happens if you use one of the other examples, like cylon, with a higher count of leds?
Cyclone is the same. Could it be some kind of power issue?
For the Uno and the Mega I am taking the power for the strip from VIN (i know this is risky but I’m only powering a few LEDs). When I tested the Feather M0 as my controller I had a separate power line running to the strip.
That wouldn’t explain why the DotStar library works with the same wiring but might be a clue…
I can re-wire the with separate power to the strip tomorrow and see what that gives us.
That said - FastLED tends to drive spi faster than other libraries - not just in terms of clock but also timing between — I was really hoping my mega2560/apa102 setup here would recreate what you were seeing. Out of curiosity, what happens if you use SK9822 instead of APA102 as the led type? I’ve heard that some places have silently swapped them out - and while apa102’s will work with the sk9822 protocol, I don’t remember of the reverse is true (and I haven’t decided whether or not I want to flatten them together)
Out of curiosity - could you also toss up, in a gist, the .ino file for the code you’re running using the adafruit library? (I haven’t used it, so I want to see/compare it to what you’re doing with FastLED)