0,0 → 1,70 |
#include "LPD8806_kopterlight.h" |
#include "SPI.h" |
|
/*****************************************************************************/ |
// Kopter light control on LPD8806-based RGB LED Modules in a strip! |
/*****************************************************************************/ |
|
/*****************************************************************************/ |
// To be changed according to your setup |
// The LED strips are 40 LEDs per meter but you can extend/cut the strip |
|
#define rigger 1 // number of rigger (default: 4) |
#define riggerSize 201 // Pixels / LEDs per rigger (default: 10) |
|
#define stripSize (riggerSize*rigger) |
|
// Use only if Hardware SPI is not possible |
// int dataPin = 3; // Software SPI Data Pin |
// int clockPin = 2; // Software SPI Clock Pin |
// Soft SPI |
// LPD8806 strip = LPD8806(stripSize, dataPin, clockPin, rigger); |
|
// HW SPI |
// on Arduino 168/328 thats data = 11, and clock = pin 13 |
LPD8806 strip = LPD8806(stripSize, rigger); |
|
/*****************************************************************************/ |
//Do not change or remove these! |
void setup() { |
// Start up the LED strip |
strip.begin(); |
// Update the strip, to start they are all 'off' |
strip.show(); |
} |
|
/*****************************************************************************/ |
// Space for your light effects: |
/*****************************************************************************/ |
// Only inside Void Loop() you are allowed to design your light effects !! |
// ( If you like to program a new pattern or sequences, refer to sequences.ino) |
/*****************************************************************************/ |
// Parameter: Colors are defined by the additive RGB color model. |
// n = LED No on rigger |
// r = red ( max. 127) |
// g = green ( max. 127) |
// b = blue ( max. 127) |
// dly = delay ( typical: 10 - 50 ) |
// cyl = cyles ( how many times this sequence will repeat ) |
// riX = rigger to set pixel / to show sequence on x= number of rigger |
/*****************************************************************************/ |
void loop() { |
|
clearstrip (); |
fadein(90,0,0,6,1,0,0,0,0,0,0,0); // red |
fadeout(90,0,0,6,1,0,0,0,0,0,0,0); // red |
fadein(0,90,0,6,1,0,0,0,0,0,0,0); // green |
fadeout(0,90,0,6,1,0,0,0,0,0,0,0); // green |
fadein(0,0,90,6,1,0,0,0,0,0,0,0); // blue |
fadeout(0,0,90,6,1,0,0,0,0,0,0,0); // blue |
|
colorChaseRev(127,0,0,50,1,0,0,0,0,0,0,0); // red |
colorChase(0,127,0,50,1,0,0,0,0,0,0,0); // green |
colorChaseRev(0,0,127,50,1,0,0,0,0,0,0,0); // blue |
|
} |
/*****************************************************************************/ |
|
|
|
|