Initial commit

This commit is contained in:
Alex Janka 2016-04-15 21:09:02 +10:00
commit 5cd9fc7e6e
3 changed files with 132 additions and 0 deletions

37
Neopixel/Neopixel.ino Normal file
View file

@ -0,0 +1,37 @@
#include <Adafruit_NeoPixel.h>
#define PIN 6
Adafruit_NeoPixel strip = Adafruit_NeoPixel(30, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
// put your setup code here, to run once:
strip.begin();
//strip.setBrightness(50);
strip.show();
}
void loop() {
// put your main code here, to run repeatedly:
/*for(int j=100; j<256; j++)
{
for(int i=0; i<30; i++)
{
strip.setPixelColor(i, j * (52 + (i * 7)), 0, j * ((255-i) * 7));
}
strip.show();
delay(100);
}*/
strip.setPixelColor(0, 255, 255, 255);
strip.show();
delay(100);
/*for(int i=0; i<30; i++)
{
strip.setPixelColor(i, 0, 0, 0);
}
strip.show();
delay(100);*/
}

2
README.md Normal file
View file

@ -0,0 +1,2 @@
# StripLighting
## various WS2812B strip Arduino scripts

View file

@ -0,0 +1,93 @@
#include <FastLED.h>
#define NUM_LEDS 30
#define DATA_PIN 6
int DELAY = 50;
#define FULLSPECTRUM true
#define BRIGHTNESS 255
CRGB leds[NUM_LEDS];
int im_hue = 0;
void setup() {
// put your setup code here, to run once:
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
// put your main code here, to run repeatedly:
#if FULLSPECTRUM
for(int i=135; i<255; i++)
{
for(int j=0; j<30; j++)
{
im_hue = i + (j * 3);
if(im_hue > 255)
{
im_hue = 255 - (im_hue - 255);
}
leds[j] = CHSV(im_hue, 255, BRIGHTNESS);
}
FastLED.show();
//DELAY = analogRead(0);
delay(DELAY);
}
for(int i=255; i>135; i--)
{
for(int j=0; j<30; j++)
{
im_hue = i + (j * 3);
if(im_hue > 255)
{
im_hue = 255 - (im_hue - 255);
}
leds[j] = CHSV(im_hue, 255, BRIGHTNESS);
}
FastLED.show();
//DELAY = analogRead(0);
delay(DELAY);
}
#else
for(int i=0; i<255; i++)
{
for(int j=0; j<30; j++)
{
im_hue = i + (j * 3);
if(im_hue > 255)
{
im_hue = 255 - (im_hue - 255);
}
leds[j] = CHSV(im_hue, 255, BRIGHTNESS);
}
FastLED.show();
//DELAY = analogRead(0);
delay(DELAY);
}
for(int i=255; i>0; i--)
{
for(int j=0; j<30; j++)
{
im_hue = i + (j * 3);
if(im_hue > 255)
{
im_hue = 255 - (im_hue - 255);
}
leds[j] = CHSV(im_hue, 255, BRIGHTNESS);
}
FastLED.show();
//DELAY = analogRead(0);
delay(DELAY);
}
#endif
}