Hello
As a beginner with Arduino libraries I need help regard creating an instance of FastLED. I was trying to create an object “myLED” but I did not succeed at the end.
Please take a look at my example:
#include “FastLED.h”
// How many leds in your strip?
#define NUM_LEDS 1
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 3
#define CLOCK_PIN 13
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
FastLED myLED = FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
// I create myLED object
}
void loop() {
// Turn the LED on, then pause
leds[0] = CRGB::Red;
myLED.show();
delay(500);
// Now turn the LED off, then pause
leds[0] = CRGB::Black;
myLED.show();
delay(500);
}
This is my first use of library, I would like to learn how to create an instance of
class FastLED. Is it ok to train myself around libraries with this library? If I look at stepper motor example in Arduino IDE the instantiate doesn’t look so difficult. Please tell me how to do it. Best Regards, Branko