-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dhananjay Balan
committed
May 3, 2017
1 parent
88ec673
commit 01ef6b4
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* LED Strip host. | ||
* | ||
* Turns LEDs red (for now) | ||
*/ | ||
|
||
#include "Arduino.h" | ||
#include <FastLED.h> | ||
|
||
#ifndef LED_BUILTIN | ||
#define LED_BUILTIN 13 | ||
#endif | ||
|
||
#define NUM_LEDS 300 | ||
#define DATA_PIN 6 | ||
|
||
CRGB leds[NUM_LEDS]; | ||
int count = 0; | ||
|
||
void setup() | ||
{ | ||
// Init fastled | ||
FastLED.addLeds<WS2812, DATA_PIN, BGR>(leds, NUM_LEDS); | ||
} | ||
|
||
void loop() | ||
{ | ||
int i; | ||
for (i=0;i<=count;i++) | ||
leds[i] = CRGB::Blue; | ||
|
||
for (;i<NUM_LEDS;i++) | ||
leds[i] = CRGB::White; | ||
|
||
count++; | ||
if (count >= NUM_LEDS) | ||
count = 0; | ||
|
||
FastLED.show(); | ||
// wait for a second | ||
delay(100); | ||
} |