I started to test the other file included in example folder of Non-Blocking WS2812 LED Library : FastLED_Cylon.ino
Code:
// FastLED Cylon Example, using Non-Blocking WS2812Serial
#include <WS2812Serial.h>
#define USE_WS2812SERIAL
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 4
// Usable pins:
// Teensy LC: 1, 4, 5, 24
// Teensy 3.2: 1, 5, 8, 10, 31 (overclock to 120 MHz for pin 8)
// Teensy 3.5: 1, 5, 8, 10, 26, 32, 33, 48
// Teensy 3.6: 1, 5, 8, 10, 26, 32, 33
#define DATA_PIN 1
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
Serial.begin(57600);
Serial.println("resetting");
LEDS.addLeds<WS2812SERIAL,DATA_PIN,RGB>(leds,NUM_LEDS);
LEDS.setBrightness(84);
}
void fadeall() { for(int i = 0; i < NUM_LEDS; i++) { leds[i].nscale8(250); } }
void loop() {
static uint8_t hue = 0;
Serial.print("x");
// First slide the led in one direction
for(int i = 0; i < NUM_LEDS; i++) {
// Set the i'th led to red
leds[i] = CHSV(hue++, 255, 255);
// Show the leds
FastLED.show();
// now that we've shown the leds, reset the i'th led to black
// leds[i] = CRGB::Black;
fadeall();
// Wait a little bit before we loop around and do it again
delay(20);
}
Serial.print("x");
// Now go in the other direction.
for(int i = (NUM_LEDS)-1; i >= 0; i--) {
// Set the i'th led to red
leds[i] = CHSV(hue++, 255, 255);
// Show the leds
FastLED.show();
// now that we've shown the leds, reset the i'th led to black
// leds[i] = CRGB::Black;
fadeall();
// Wait a little bit before we loop around and do it again
delay(20);
}
}
Ant i got following compiling error:
Code:
Arduino: 1.8.9 (Linux), TD: 1.48, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English"
In file included from /home/alphi/Arduino/libraries/WS2812Serial-T4/examples/FastLED_Cylon/FastLED_Cylon.ino:5:0:
/home/alphi/Arduino/libraries/FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.002
# pragma message "FastLED version 3.003.002"
^
In file included from /home/alphi/Arduino/libraries/WS2812Serial-T4/examples/FastLED_Cylon/FastLED_Cylon.ino:5:0:
/home/alphi/Arduino/libraries/FastLED/FastLED.h: In static member function 'static CLEDController& CFastLED::addLeds(CRGB*, int, int)':
/home/alphi/Arduino/libraries/FastLED/FastLED.h:393:10: error: 'CWS2812SerialController' does not name a type
static CWS2812SerialController<DATA_PIN,RGB_ORDER> controller;
^
/home/alphi/Arduino/libraries/FastLED/FastLED.h:394:19: error: 'controller' was not declared in this scope
return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset);
^
Using library WS2812Serial-T4 in folder: /home/alphi/Arduino/libraries/WS2812Serial-T4 (legacy)
Using library FastLED at version 3.3.2 in folder: /home/alphi/Arduino/libraries/FastLED
Using library SPI at version 1.0 in folder: /home/alphi/Downloads/arduino-1.8.9-linux64/arduino-1.8.9/hardware/teensy/avr/libraries/SPI
Error compiling for board Teensy 4.0.