Devices & Components
1
Arduino Micro
Project description
Code
Code
arduino
Downloadable files
Schematic
Schematic

Schematic
Schematic

Comments
Only logged in users can leave comments
Devices & Components
Arduino Micro
Project description
Code
Code
arduino
1// Include Libraries 2#include "FastLED.h" 3 4// Define Global Variables 5#define NUM_LEDS 300 // How many LEDs are in the strip 6#define DATA_PIN 2 // Which pin on the Arduino? 7int fadeAmount = 5; // How fast does it fade? e.g. Higher number = faster fade. 8int brightness = 0; 9 10// Define the LED Array 11CRGB leds[NUM_LEDS]; 12 13void setup() { 14 // Based on which LEDs you're using. See FastLED docs. 15 FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS); 16} 17 18void loop() { 19 20 for(int i = 0; i < NUM_LEDS; i++ ) 21 { 22 leds[i].setRGB(47,49,61); // Set Color (RGB) 23 leds[i].fadeLightBy(brightness); 24 } 25 FastLED.show(); 26 brightness = brightness + fadeAmount; 27 28 if(brightness == 0 || brightness == 255) 29 { 30 if(brightness == 0){ 31 delay(20000); 32 } 33 fadeAmount = -fadeAmount ; 34 } 35 delay(10); 36 37}
Downloadable files
Schematic
Schematic

Schematic
Schematic

Comments
Only logged in users can leave comments