Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h> // Uses FastLED Library to drive WS2812B 'Neopixel' LEDs
- #define LED_PIN D4 // The pin connected to Data In on the strip
- #define NUM_LEDS 5 // Number of LED's on your strip
- #define LED_BRIGHTNESS 50 // set Brightness value
- #define MILLI_AMPS 2400 // Maximum current your power source can deliver in mA
- #define CONNECTION_COLOR 0xFF4500 // Purple WiFi connection status color
- CRGB leds[NUM_LEDS];
- void setup() {
- Serial.begin(115200);
- FastLED.addLeds<WS2811, LED_PIN, RGB>(leds, NUM_LEDS);
- FastLED.setDither(false);
- FastLED.setBrightness(LED_BRIGHTNESS);
- FastLED.setMaxPowerInVoltsAndMilliamps(5, MILLI_AMPS);
- }
- void loop() {
- leds[0] = CRGB::White; FastLED.show(); delay(3000);
- leds[0] = CRGB::Red; FastLED.show(); delay(3000);
- leds[1] = CRGB::White; FastLED.show(); delay(3000);
- leds[1] = CRGB::Red; FastLED.show(); delay(3000);
- leds[2] = CRGB::White; FastLED.show(); delay(3000);
- leds[2] = CRGB::Red; FastLED.show(); delay(3000);
- leds[3] = CRGB::White; FastLED.show(); delay(3000);
- leds[3] = CRGB::Red; FastLED.show(); delay(3000);
- leds[4] = CRGB::White; FastLED.show(); delay(3000);
- leds[4] = CRGB::Red; FastLED.show(); delay(3000);
- }
Advertisement
Add Comment
Please, Sign In to add comment