Guest User

Untitled

a guest
Nov 7th, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.90 KB | None | 0 0
  1. #define FASTLED_ALLOW_INTERRUPTS 0 //Tried with and without this. same results.
  2. #include "FastLED.h"
  3.  
  4. // How many leds in your strip?
  5. #define NUM_LEDS 15
  6.  
  7. // For led chips like Neopixels, which have a data line, ground, and power, you just
  8. // need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
  9. // ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
  10. #define DATA_PIN 16
  11.  
  12. // Define the array of leds
  13. CRGB leds[NUM_LEDS];
  14.  
  15. void setup() {
  16.     Serial.begin(115200);
  17.     Serial.println("Hello, you've entered setup()...");
  18.     FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
  19. }
  20.  
  21. void loop() {
  22.   // Turn the LED on, then pause
  23.   leds[1] = CRGB::Red;
  24.   FastLED.show();
  25.   Serial.println("red...");
  26.   delay(1000);
  27.   Serial.println("blue...");
  28.   // Now turn the LED off, then pause
  29.   leds[1] = CRGB::Blue;
  30.   FastLED.show();
  31.   delay(1000);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment