├── libraries └── readme.txt ├── neo_drip ├── neo_drip.ino └── neo_rip2 │ └── neo_rip2.ino ├── neo_random ├── neo_drip │ ├── neo_drip.ino │ └── neo_rip2 │ │ └── neo_rip2.ino ├── neo_random.ino ├── neo_random2 │ └── neo_random2.ino ├── neo_rainbow2 │ └── neo_rainbow2.ino ├── neo_Rainbow │ ├── neo_Rainbow_ino │ │ └── neo_Rainbow_ino.ino │ └── neo_Rainbow.ino ├── neo_cylon │ └── neo_cylon.ino ├── neo_pattern │ └── neo_pattern.ino ├── neo_nightrider │ └── neo_nightrider.ino ├── neo_carprogram │ └── neo_carprogram.ino └── neo_carprogramportable │ └── neo_carprogramportable.ino ├── neo_random3 └── neo_random3.ino ├── neo_classroomrandom └── neo_classroomrandom.ino ├── neo_classroomxmas └── neo_classroomxmas.ino ├── neo_random2 └── neo_random2.ino ├── neo_twinkle └── neo_twinkle.ino ├── neo_rainbow2 └── neo_rainbow2.ino ├── neo_Rainbow ├── neo_Rainbow_ino │ └── neo_Rainbow_ino.ino └── neo_Rainbow.ino ├── neo_cylon └── neo_cylon.ino ├── neo_chaserlights └── neo_chaserlights.ino ├── neo_halloween2 └── neo_halloween2.ino ├── neo_halloween3 └── neo_halloween3.ino ├── neo_halloweenfrontdoor1 └── neo_halloweenfrontdoor1.ino ├── neo_threearound └── neo_threearound.ino ├── neo_slowfaderainbow └── neo_slowfaderainbow.ino ├── neo_xmaslights1 └── neo_xmaslights1.ino ├── neo_xmaslightswhite └── neo_xmaslightswhite.ino ├── neo_xmas └── neo_xmas.ino ├── neo_pattern └── neo_pattern.ino ├── neo_randomdrip └── neo_randomdrip.ino ├── neo_slowfadewholestrip └── neo_slowfadewholestrip.ino ├── neo_strandtest └── neo_strandtest.ino ├── blinking_chaser └── blinking_chaser.ino ├── neo_nightrider └── neo_nightrider.ino ├── neo_randomcylon └── neo_randomcylon.ino ├── neo_classroom └── neo_classroom.ino ├── ledstrip_rainbow └── ledstrip_rainbow.ino ├── neo_carprogram └── neo_carprogram.ino ├── neo_carprogramportable └── neo_carprogramportable.ino ├── ledstrip_sample └── ledstrip_sample.ino └── soundNeo └── soundNeo.ino /libraries/readme.txt: -------------------------------------------------------------------------------- 1 | For information on installing libraries, see: http://arduino.cc/en/Guide/Libraries 2 | -------------------------------------------------------------------------------- /neo_drip/neo_drip.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | void setup() { 8 | strip.begin(); 9 | strip.show(); // Initialize all pixels to 'off' 10 | } 11 | void loop() { 12 | colorWipe (0, 0, 255, 50); // the 4th number controls the speed 13 | } 14 | void colorWipe(int r, int g, int b, int wait) { 15 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | void setup() { 8 | strip.begin(); 9 | strip.show(); // Initialize all pixels to 'off' 10 | } 11 | void loop() { 12 | colorWipe (0, 0, 255, 50); // the 4th number controls the speed 13 | } 14 | void colorWipe(int r, int g, int b, int wait) { 15 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | void setup() { 8 | strip.begin(); 9 | strip.show(); // Initialize all pixels to 'off' 10 | } 11 | void loop() { 12 | int randr = random(0,205); 13 | int randg = random(0,205); 14 | int randb = random(0,205); 15 | colorWipe (randr, randg ,randb , 5); // the 4th number controls the speed 16 | } 17 | void colorWipe(int r, int g, int b, int wait) { 18 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | int bright = 1; //select 1 thru 10 7 | 8 | void setup() { 9 | strip.begin(); 10 | strip.show(); // Initialize all pixels to 'off' 11 | } 12 | void loop() { 13 | for(int i=0; i 2 | 3 | #define PIN 5 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(180, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | int bright = 5; //select 1 thru 10 7 | 8 | void setup() { 9 | strip.begin(); 10 | strip.show(); // Initialize all pixels to 'off' 11 | } 12 | void loop() { 13 | for(int i=0; i 2 | 3 | #define PIN 5 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(180, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | int bright = 7; //select 1 thru 10 7 | 8 | void setup() { 9 | strip.begin(); 10 | strip.show(); // Initialize all pixels to 'off' 11 | } 12 | void loop() { 13 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | int bright = 1; //select 1 thru 10 7 | int wait = 2 ; //select for speed 8 | 9 | void setup() { 10 | strip.begin(); 11 | strip.show(); // Initialize all pixels to 'off' 12 | } 13 | void loop() { 14 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | int bright = 10; //select 1 thru 10 7 | int wait = 100; //select speed of blinking 8 | 9 | void setup() { 10 | strip.begin(); 11 | strip.show(); // Initialize all pixels to 'off' 12 | } 13 | void loop() { 14 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | int bright = 1; //select 1 thru 10 7 | int wait = 2 ; //select for speed 8 | 9 | void setup() { 10 | strip.begin(); 11 | strip.show(); // Initialize all pixels to 'off' 12 | } 13 | void loop() { 14 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | void setup() { 8 | strip.begin(); 9 | strip.show(); // Initialize all pixels to 'off' 10 | } 11 | void loop() { 12 | int p=2; 13 | colorWipe(255, 0, 0, p); // Red 14 | colorWipe(255, 127, 0, p); // Red 15 | colorWipe(255, 255, 0, p); // Green 16 | colorWipe(0, 255, 0, p); // Green 17 | colorWipe(0, 0, 255, p); // Blue 18 | colorWipe(75, 0, 130, p); // Red 19 | colorWipe(255, 255, 255, p); // Red 20 | colorWipe(75, 0, 130, p); // Red 21 | colorWipe(0, 0, 255, p); // Red 22 | colorWipe(0, 255, 0, p); // Red 23 | colorWipe(255, 255, 0, p); // Green 24 | colorWipe(255, 127, 0, p); // Green // the 4th number controls the speed 25 | } 26 | void colorWipe(int r, int g, int b, int wait) { 27 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | void setup() { 8 | strip.begin(); 9 | strip.show(); // Initialize all pixels to 'off' 10 | } 11 | void loop() { 12 | int p=2; 13 | colorWipe(255, 0, 0, p); // Red 14 | colorWipe(255, 127, 0, p); // Red 15 | colorWipe(255, 255, 0, p); // Green 16 | colorWipe(0, 255, 0, p); // Green 17 | colorWipe(0, 0, 255, p); // Blue 18 | colorWipe(75, 0, 130, p); // Red 19 | colorWipe(255, 255, 255, p); // Red 20 | colorWipe(75, 0, 130, p); // Red 21 | colorWipe(0, 0, 255, p); // Red 22 | colorWipe(0, 255, 0, p); // Red 23 | colorWipe(255, 255, 0, p); // Green 24 | colorWipe(255, 127, 0, p); // Green // the 4th number controls the speed 25 | } 26 | void colorWipe(int r, int g, int b, int wait) { 27 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | void setup() { 8 | strip.begin(); 9 | strip.show(); // Initialize all pixels to 'off' 10 | } 11 | void loop() { 12 | int p=10; 13 | colorWipe(255, 0, 0, p); // Red 14 | colorWipe(255, 127, 0, p); // Red 15 | colorWipe(255, 255, 0, p); // Green 16 | colorWipe(0, 255, 0, p); // Green 17 | colorWipe(0, 0, 255, p); // Blue 18 | colorWipe(75, 0, 130, p); // Red 19 | colorWipe(255, 255, 255, p); // Red 20 | colorWipe(75, 0, 130, p); // Red 21 | colorWipe(0, 0, 255, p); // Red 22 | colorWipe(0, 255, 0, p); // Red 23 | colorWipe(255, 255, 0, p); // Green 24 | colorWipe(255, 127, 0, p); // Green // the 4th number controls the speed 25 | } 26 | void colorWipe(int r, int g, int b, int wait) { 27 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | void setup() { 8 | strip.begin(); 9 | strip.show(); // Initialize all pixels to 'off' 10 | } 11 | void loop() { 12 | int p=10; 13 | colorWipe(255, 0, 0, p); // Red 14 | colorWipe(255, 127, 0, p); // Red 15 | colorWipe(255, 255, 0, p); // Green 16 | colorWipe(0, 255, 0, p); // Green 17 | colorWipe(0, 0, 255, p); // Blue 18 | colorWipe(75, 0, 130, p); // Red 19 | colorWipe(255, 255, 255, p); // Red 20 | colorWipe(75, 0, 130, p); // Red 21 | colorWipe(0, 0, 255, p); // Red 22 | colorWipe(0, 255, 0, p); // Red 23 | colorWipe(255, 255, 0, p); // Green 24 | colorWipe(255, 127, 0, p); // Green // the 4th number controls the speed 25 | } 26 | void colorWipe(int r, int g, int b, int wait) { 27 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | int bright = 10; //select 1 thru 10 8 | int wait = 10; //speed of leds 9 | 10 | 11 | void setup() { 12 | strip.begin(); 13 | strip.show(); // Initialize all pixels to 'off' 14 | } 15 | void loop() { 16 | 17 | 18 | void colorWipe(int r, int g, int b, int wait); { 19 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | int bright = 10; //select 1 thru 10 8 | int wait = 10; //speed of leds 9 | 10 | 11 | void setup() { 12 | strip.begin(); 13 | strip.show(); // Initialize all pixels to 'off' 14 | } 15 | void loop() { 16 | 17 | 18 | void colorWipe(int r, int g, int b, int wait); { 19 | for(int i=0; i 2 | 3 | #define PIN 5 4 | #define NUM_LED 180 5 | #define SEG_LEN 10 6 | 7 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LED, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 8 | 9 | int wait=100; //speed 10 | 11 | int num_segments = NUM_LED / SEG_LEN; 12 | int num_colors = 3; 13 | int colors[3][3]; //= (int*)malloc(sizeof(int*num_colors)); 14 | 15 | int offset = 0; 16 | 17 | void setup() { 18 | // Choose colors (be sure you make 19 | colors[0][0] = 255; //r (of first color) 20 | colors[0][1] = 0; //b //orange 21 | colors[0][2] = 0; //g 22 | 23 | colors[1][0] = 0; 24 | colors[1][1] = 255; //purple 25 | colors[1][2] = 0; 26 | 27 | colors[2][0] = 0; 28 | colors[2][1] = 0; //green 29 | colors[2][2] = 255; 30 | 31 | strip.begin(); 32 | strip.show(); // Initialize all pixels to 'off' 33 | 34 | 35 | } 36 | void loop() { 37 | 38 | offset = (offset+1)%NUM_LED; 39 | updateLed(offset,wait); 40 | } 41 | 42 | void updateLed(int offset,int wait){ 43 | int i; 44 | for(i=0; i 2 | 3 | #define PIN 5 4 | #define NUM_LED 180 5 | #define SEG_LEN 10 6 | 7 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LED, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 8 | int wait= 25; //speed of flashing 9 | 10 | int num_segments = NUM_LED / SEG_LEN; 11 | int num_colors = 3; 12 | int colors[3][3]; //= (int*)malloc(sizeof(int*num_colors)); 13 | 14 | int offset = 0; 15 | 16 | void setup() { 17 | // Choose colors (be sure you make 18 | colors[0][0] = 255; //r (of first color) 19 | colors[0][1] = 50; //b //orange 20 | colors[0][2] = 0; //g 21 | 22 | colors[1][0] = 0; 23 | colors[1][1] = 0; //purple 24 | colors[1][2] = 0; 25 | 26 | colors[2][0] = 0; 27 | colors[2][1] = 0; //green 28 | colors[2][2] = 0; 29 | 30 | strip.begin(); 31 | strip.show(); // Initialize all pixels to 'off' 32 | 33 | 34 | } 35 | void loop() { 36 | 37 | offset = (offset+1)%NUM_LED; 38 | updateLed(offset,wait); 39 | } 40 | 41 | void updateLed(int offset,int wait){ 42 | int i; 43 | for(i=0; i 2 | 3 | #define PIN 5 4 | #define NUM_LED 180 5 | #define SEG_LEN 1 6 | 7 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LED, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 8 | int wait= 100; //speed of flashing 9 | 10 | int num_segments = NUM_LED / SEG_LEN; 11 | int num_colors = 3; 12 | int colors[3][3]; //= (int*)malloc(sizeof(int*num_colors)); 13 | 14 | int offset = 0; 15 | 16 | void setup() { 17 | // Choose colors (be sure you make 18 | colors[0][0] = 255; //r (of first color) 19 | colors[0][1] = 50; //b //orange 20 | colors[0][2] = 0; //g 21 | 22 | colors[1][0] = 0; 23 | colors[1][1] = 0; //purple 24 | colors[1][2] = 0; 25 | 26 | colors[2][0] = 0; 27 | colors[2][1] = 0; //green 28 | colors[2][2] = 0; 29 | 30 | strip.begin(); 31 | strip.show(); // Initialize all pixels to 'off' 32 | 33 | 34 | } 35 | void loop() { 36 | 37 | offset = (offset+1)%NUM_LED; 38 | updateLed(offset,wait); 39 | } 40 | 41 | void updateLed(int offset,int wait){ 42 | int i; 43 | for(i=0; i 2 | 3 | #define PIN 6 4 | #define NUM_LED 50 5 | #define SEG_LEN 2 6 | 7 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LED, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 8 | int wait= 100; //speed of flashing 9 | 10 | int num_segments = NUM_LED / SEG_LEN; 11 | int num_colors = 3; 12 | int colors[3][3]; //= (int*)malloc(sizeof(int*num_colors)); 13 | 14 | int offset = 0; 15 | 16 | void setup() { 17 | // Choose colors (be sure you make 18 | colors[0][0] = 255; //r (of first color) 19 | colors[0][1] = 50; //b //orange 20 | colors[0][2] = 0; //g 21 | 22 | colors[1][0] = 20; 23 | colors[1][1] = 0; //purple0, 250, 50 24 | colors[1][2] = 20; 25 | 26 | colors[2][0] = 0; 27 | colors[2][1] = 50; //green 28 | colors[2][2] = 10; 29 | 30 | strip.begin(); 31 | strip.show(); // Initialize all pixels to 'off' 32 | 33 | 34 | } 35 | void loop() { 36 | 37 | offset = (offset+1)%NUM_LED; 38 | updateLed(offset,wait); 39 | } 40 | 41 | void updateLed(int offset,int wait){ 42 | int i; 43 | for(i=0; i 2 | 3 | #define PIN 5 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(185, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | void setup() { 8 | strip.begin(); 9 | strip.show(); // Initialize all pixels to 'off' 10 | } 11 | void loop() { 12 | int p=0; 13 | colorWipe(255, 0, 0, p); // Red 14 | colorWipe(255, 127, 0, p); // Red 15 | colorWipe(255, 255, 0, p); // Green 16 | colorWipe(0, 255, 0, p); // Green 17 | colorWipe(0, 0, 255, p); // Blue 18 | colorWipe(75, 0, 130, p); // Red 19 | colorWipe(255, 255, 255, p); // Red 20 | colorWipe(75, 0, 130, p); // Red 21 | colorWipe(0, 0, 255, p); // Red 22 | colorWipe(0, 255, 0, p); // Red 23 | colorWipe(255, 255, 0, p); // Green 24 | colorWipe(255, 127, 0, p); // Green // the 4th number controls the speed 25 | } 26 | void colorWipe(int r, int g, int b, int wait) { 27 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800); //first number change does distance between colors 6 | 7 | void setup() { 8 | strip.begin(); 9 | strip.show(); // Initialize all pixels to 'off' 10 | 11 | } 12 | void loop() { 13 | // Some example procedures showing how to display to the pixels: 14 | rainbowCycle(2); // change for speed 15 | } 16 | 17 | // Fill the dots one after the other with a color 18 | void colorWipe(uint32_t c, uint8_t wait) { 19 | for(uint16_t i=0; i 2 | 3 | #define PIN 5 4 | #define NUM_LED 180 5 | #define SEG_LEN 1 6 | 7 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LED, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 8 | int wait= 100; //speed of flashing 9 | 10 | int num_segments = NUM_LED / SEG_LEN; 11 | int num_colors = 5; 12 | int colors[5][3]; //= (int*)malloc(sizeof(int*num_colors)); 13 | 14 | int offset = 0; 15 | 16 | void setup() { 17 | // Choose colors (be sure you make 18 | colors[0][0] = 200; //r (of first color) 19 | colors[0][1] = 20; //g //orange 20 | colors[0][2] = 0; //b 21 | 22 | colors[1][0] = 0; 23 | colors[1][1] = 20; 24 | colors[1][2] = 200; 25 | 26 | colors[2][0] = 0; 27 | colors[2][1] = 200; //green 28 | colors[2][2] = 20; 29 | 30 | colors[3][0] = 0; 31 | colors[3][1] = 175; //green 32 | colors[3][2] = 200; 33 | 34 | colors[4][0] = 100; 35 | colors[4][1] = 100; //green 36 | colors[4][2] = 100; 37 | 38 | strip.begin(); 39 | strip.show(); // Initialize all pixels to 'off' 40 | 41 | 42 | } 43 | void loop() { 44 | 45 | offset = (offset+1)%NUM_LED; 46 | updateLed(offset,wait); 47 | } 48 | 49 | void updateLed(int offset,int wait){ 50 | int i; 51 | for(i=0; i 2 | 3 | #define PIN 5 4 | #define NUM_LED 180 5 | #define SEG_LEN 1 6 | 7 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LED, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 8 | int wait= 100; //speed of flashing 9 | 10 | int num_segments = NUM_LED / SEG_LEN; 11 | int num_colors = 5; 12 | int colors[5][3]; //= (int*)malloc(sizeof(int*num_colors)); 13 | 14 | int offset = 0; 15 | 16 | void setup() { 17 | // Choose colors (be sure you make 18 | colors[0][0] = 0; //r (of first color) 19 | colors[0][1] = 0; //g //orange 20 | colors[0][2] = 0; //b 21 | 22 | colors[1][0] = 20; 23 | colors[1][1] = 20; 24 | colors[1][2] = 20; 25 | 26 | colors[2][0] = 50; 27 | colors[2][1] = 50; //green 28 | colors[2][2] = 50; 29 | 30 | colors[3][0] = 75; 31 | colors[3][1] = 75; //green 32 | colors[3][2] = 75; 33 | 34 | colors[4][0] = 255; 35 | colors[4][1] = 255; //green 36 | colors[4][2] = 255; 37 | 38 | strip.begin(); 39 | strip.show(); // Initialize all pixels to 'off' 40 | 41 | 42 | } 43 | void loop() { 44 | 45 | offset = (offset+1)%NUM_LED; 46 | updateLed(offset,wait); 47 | } 48 | 49 | void updateLed(int offset,int wait){ 50 | int i; 51 | for(i=0; i 2 | 3 | #define PIN 6 4 | 5 | // Parameter 1 = number of pixels in strip 6 | // Parameter 2 = pin number (most are valid) 7 | // Parameter 3 = pixel type flags, add together as needed: 8 | // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) 9 | // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) 10 | // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) 11 | // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) 12 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(8, PIN, NEO_GRB + NEO_KHZ800); 13 | 14 | void setup() { 15 | strip.begin(); 16 | strip.show(); // Initialize all pixels to 'off' 17 | } 18 | 19 | void loop() { 20 | // Some example procedures showing how to display to the pixels: 21 | // colorWipe(strip.Color(255, 0, 0), 50); // Red 22 | // colorWipe(strip.Color(0, 255, 0), 50); // Green 23 | // colorWipe(strip.Color(0, 0, 255), 50); // Blue 24 | // rainbow(20); 25 | rainbowCycle(20); 26 | } 27 | 28 | 29 | // Slightly different, this makes the rainbow equally distributed throughout 30 | void rainbowCycle(uint8_t wait) { 31 | uint16_t i, j; 32 | 33 | for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel 34 | for(i=0; i< strip.numPixels(); i++) { 35 | strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255)); 36 | } 37 | strip.show(); 38 | delay(wait); 39 | } 40 | } 41 | 42 | // Input a value 0 to 255 to get a color value. 43 | // The colours are a transition r - g - b - back to r. 44 | uint32_t Wheel(byte WheelPos) 45 | { 46 | if(WheelPos > 250) {return strip.Color(0, 0, 0);} 47 | //else if(WheelPos < 170) {WheelPos -= 85;return strip.Color(0, 0, 0;} 48 | else {WheelPos = 1; return strip.Color(0, 0, 255 - WheelPos * 10);} 49 | } 50 | 51 | -------------------------------------------------------------------------------- /neo_random/neo_drip/neo_rip2/neo_rip2.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define PIN 6 4 | 5 | // Parameter 1 = number of pixels in strip 6 | // Parameter 2 = pin number (most are valid) 7 | // Parameter 3 = pixel type flags, add together as needed: 8 | // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) 9 | // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) 10 | // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) 11 | // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) 12 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(8, PIN, NEO_GRB + NEO_KHZ800); 13 | 14 | void setup() { 15 | strip.begin(); 16 | strip.show(); // Initialize all pixels to 'off' 17 | } 18 | 19 | void loop() { 20 | // Some example procedures showing how to display to the pixels: 21 | // colorWipe(strip.Color(255, 0, 0), 50); // Red 22 | // colorWipe(strip.Color(0, 255, 0), 50); // Green 23 | // colorWipe(strip.Color(0, 0, 255), 50); // Blue 24 | // rainbow(20); 25 | rainbowCycle(20); 26 | } 27 | 28 | 29 | // Slightly different, this makes the rainbow equally distributed throughout 30 | void rainbowCycle(uint8_t wait) { 31 | uint16_t i, j; 32 | 33 | for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel 34 | for(i=0; i< strip.numPixels(); i++) { 35 | strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255)); 36 | } 37 | strip.show(); 38 | delay(wait); 39 | } 40 | } 41 | 42 | // Input a value 0 to 255 to get a color value. 43 | // The colours are a transition r - g - b - back to r. 44 | uint32_t Wheel(byte WheelPos) 45 | { 46 | if(WheelPos > 250) {return strip.Color(0, 0, 0);} 47 | //else if(WheelPos < 170) {WheelPos -= 85;return strip.Color(0, 0, 0;} 48 | else {WheelPos = 1; return strip.Color(0, 0, 255 - WheelPos * 10);} 49 | } 50 | 51 | -------------------------------------------------------------------------------- /neo_Rainbow/neo_Rainbow.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define PIN 6 4 | 5 | // Parameter 1 = number of pixels in strip 6 | // Parameter 2 = pin number (most are valid) 7 | // Parameter 3 = pixel type flags, add together as needed: 8 | // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) 9 | // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) 10 | // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) 11 | // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) 12 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800); 13 | 14 | void setup() { 15 | strip.begin(); 16 | strip.show(); // Initialize all pixels to 'off' 17 | } 18 | 19 | void loop() { 20 | // Some example procedures showing how to display to the pixels: 21 | colorWipe(strip.Color(255, 0, 0), 5); // Red 22 | colorWipe(strip.Color(255, 127, 0), 5); // Red 23 | colorWipe(strip.Color(255, 255, 0), 5); // Green 24 | colorWipe(strip.Color(0, 255, 0), 5); // Green 25 | colorWipe(strip.Color(0, 0, 255), 5); // Blue 26 | colorWipe(strip.Color(75, 0, 130), 5); // Red 27 | colorWipe(strip.Color(143, 0, 255), 5); // Red 28 | colorWipe(strip.Color(200, 200, 200), 5); // Red 29 | colorWipe(strip.Color(143, 0, 255), 5); // Red 30 | colorWipe(strip.Color(75, 0, 130), 5); // Red 31 | colorWipe(strip.Color(0, 0, 255), 5); // Red 32 | colorWipe(strip.Color(0, 255, 0), 5); // Red 33 | colorWipe(strip.Color(255, 255, 0), 5); // Green 34 | colorWipe(strip.Color(255, 127, 0), 5); // Green 35 | 36 | // rainbow(20); 37 | // rainbowCycle(20); 38 | } 39 | 40 | // Fill the dots one after the other with a color 41 | void colorWipe(uint32_t c, uint8_t wait) { 42 | for(uint16_t i=0; i 2 | 3 | #define PIN 5 4 | 5 | // Parameter 1 = number of pixels in strip 6 | // Parameter 2 = pin number (most are valid) 7 | // Parameter 3 = pixel type flags, add together as needed: 8 | // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) 9 | // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) 10 | // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) 11 | // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) 12 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(180, PIN, NEO_GRB + NEO_KHZ800); 13 | 14 | void setup() { 15 | strip.begin(); 16 | strip.show(); // Initialize all pixels to 'off' 17 | } 18 | 19 | void loop() { 20 | // Some example procedures showing how to display to the pixels: 21 | colorWipe(strip.Color(255, 0, 0), 5); // Red 22 | colorWipe(strip.Color(255, 127, 0), 5); // Red 23 | colorWipe(strip.Color(255, 255, 0), 5); // Green 24 | colorWipe(strip.Color(0, 255, 0), 5); // Green 25 | colorWipe(strip.Color(0, 0, 255), 5); // Blue 26 | colorWipe(strip.Color(75, 0, 130), 5); // Red 27 | colorWipe(strip.Color(143, 0, 255), 5); // Red 28 | colorWipe(strip.Color(200, 200, 200), 5); // Red 29 | colorWipe(strip.Color(143, 0, 255), 5); // Red 30 | colorWipe(strip.Color(75, 0, 130), 5); // Red 31 | colorWipe(strip.Color(0, 0, 255), 5); // Red 32 | colorWipe(strip.Color(0, 255, 0), 5); // Red 33 | colorWipe(strip.Color(255, 255, 0), 5); // Green 34 | colorWipe(strip.Color(255, 127, 0), 5); // Green 35 | 36 | // rainbow(20); 37 | // rainbowCycle(20); 38 | } 39 | 40 | // Fill the dots one after the other with a color 41 | void colorWipe(uint32_t c, uint8_t wait) { 42 | for(uint16_t i=0; i 2 | 3 | #define PIN 6 4 | 5 | // Parameter 1 = number of pixels in strip 6 | // Parameter 2 = pin number (most are valid) 7 | // Parameter 3 = pixel type flags, add together as needed: 8 | // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) 9 | // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) 10 | // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) 11 | // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) 12 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800); 13 | 14 | void setup() { 15 | strip.begin(); 16 | strip.show(); // Initialize all pixels to 'off' 17 | } 18 | 19 | void loop() { 20 | // Some example procedures showing how to display to the pixels: 21 | colorWipe(strip.Color(255, 0, 0), 5); // Red 22 | colorWipe(strip.Color(255, 127, 0), 5); // Red 23 | colorWipe(strip.Color(255, 255, 0), 5); // Green 24 | colorWipe(strip.Color(0, 255, 0), 5); // Green 25 | colorWipe(strip.Color(0, 0, 255), 5); // Blue 26 | colorWipe(strip.Color(75, 0, 130), 5); // Red 27 | colorWipe(strip.Color(143, 0, 255), 5); // Red 28 | colorWipe(strip.Color(200, 200, 200), 5); // Red 29 | colorWipe(strip.Color(143, 0, 255), 5); // Red 30 | colorWipe(strip.Color(75, 0, 130), 5); // Red 31 | colorWipe(strip.Color(0, 0, 255), 5); // Red 32 | colorWipe(strip.Color(0, 255, 0), 5); // Red 33 | colorWipe(strip.Color(255, 255, 0), 5); // Green 34 | colorWipe(strip.Color(255, 127, 0), 5); // Green 35 | 36 | // rainbow(20); 37 | // rainbowCycle(20); 38 | } 39 | 40 | // Fill the dots one after the other with a color 41 | void colorWipe(uint32_t c, uint8_t wait) { 42 | for(uint16_t i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | int bright = 10; //select 1 thru 10 8 | int wait = 5; //speed of leds 9 | 10 | void setup() { 11 | strip.begin(); 12 | strip.show(); // Initialize all pixels to 'off' 13 | } 14 | void loop() { 15 | int randr = random(0,(25*bright)); 16 | int randg = random(0,(25*bright)); 17 | int randb = random(0,(25*bright)); 18 | int randi = random(1,strip.numPixels()); 19 | int randii = random(1,strip.numPixels()); 20 | colorWipe(randr, randg, randb, wait); 21 | } 22 | void colorWipe(int r, int g, int b, int wait) { 23 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | int bright = 1; //select 1 thru 10 8 | int wait = 20; //speed of leds 9 | 10 | void setup() { 11 | strip.begin(); 12 | strip.show(); // Initialize all pixels to 'off' 13 | } 14 | void loop() { 15 | int randr = random(0,(25*bright)); 16 | int randg = random(0,(25*bright)); 17 | int randb = random(0,(25*bright)); 18 | int randi = random(1,strip.numPixels()); 19 | int randii = random(1,strip.numPixels()); 20 | colorWipe(randr, randg, randb, wait); 21 | } 22 | void colorWipe(int r, int g, int b, int wait) { 23 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | int bright = 10; //select 1 thru 10 8 | int wait = 5; //speed of leds 9 | 10 | void setup() { 11 | strip.begin(); 12 | strip.show(); // Initialize all pixels to 'off' 13 | } 14 | void loop() { 15 | int randr = random(0,(25*bright)); 16 | int randg = random(0,(25*bright)); 17 | int randb = random(0,(25*bright)); 18 | int randi = random(1,strip.numPixels()); 19 | int randii = random(1,strip.numPixels()); 20 | colorWipe(randr, randg, randb, wait); 21 | } 22 | void colorWipe(int r, int g, int b, int wait) { 23 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | // Parameter 1 = number of pixels in strip 6 | // Parameter 2 = pin number (most are valid) 7 | // Parameter 3 = pixel type flags, add together as needed: 8 | // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) 9 | // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) 10 | // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) 11 | // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) 12 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800); 13 | 14 | void setup() { 15 | strip.begin(); 16 | strip.show(); // Initialize all pixels to 'off' 17 | } 18 | 19 | void loop() { 20 | // Some example procedures showing how to display to the pixels: 21 | rainbow(20); 22 | // rainbowCycle(20); 23 | } 24 | 25 | void rainbow(uint8_t wait) { 26 | uint16_t i, j; 27 | 28 | for(j=0; j<256; j++) { 29 | for(i=0; i 2 | 3 | #define PIN 6 4 | 5 | // Parameter 1 = number of pixels in strip 6 | // Parameter 2 = pin number (most are valid) 7 | // Parameter 3 = pixel type flags, add together as needed: 8 | // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) 9 | // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) 10 | // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) 11 | // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) 12 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800); 13 | 14 | void setup() { 15 | strip.begin(); 16 | strip.show(); // Initialize all pixels to 'off' 17 | } 18 | 19 | void loop() { 20 | // Some example procedures showing how to display to the pixels: 21 | colorWipe(strip.Color(255, 0, 0), 50); // Red 22 | colorWipe(strip.Color(0, 255, 0), 50); // Green 23 | colorWipe(strip.Color(0, 0, 255), 50); // Blue 24 | rainbow(20); 25 | rainbowCycle(20); 26 | } 27 | 28 | // Fill the dots one after the other with a color 29 | void colorWipe(uint32_t c, uint8_t wait) { 30 | for(uint16_t i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | int bright = 10; //select 1 thru 10 8 | int wait = 10; //speed of leds 9 | 10 | void setup() { 11 | strip.begin(); 12 | strip.show(); // Initialize all pixels to 'off' 13 | } 14 | void loop() { 15 | int randr = 25*bright; 16 | int randg = 0; 17 | int randb = 0; 18 | colorWipe(randr, randg, randb, wait); 19 | } 20 | void colorWipe(int r, int g, int b, int wait) { 21 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | int bright = 10; //select 1 thru 10 8 | int wait = 10; //speed of leds 9 | 10 | void setup() { 11 | strip.begin(); 12 | strip.show(); // Initialize all pixels to 'off' 13 | } 14 | void loop() { 15 | int randr = 25*bright; 16 | int randg = 0; 17 | int randb = 0; 18 | colorWipe(randr, randg, randb, wait); 19 | } 20 | void colorWipe(int r, int g, int b, int wait) { 21 | for(int i=0; i 2 | 3 | #define PIN 6 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(38, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | int bright = 10; //select 1 thru 10 8 | int wait = 10; //speed of leds 9 | 10 | void setup() { 11 | strip.begin(); 12 | strip.show(); // Initialize all pixels to 'off' 13 | } 14 | void loop() { 15 | int randr = random(0,(25*bright)); 16 | int randg = random(0,(25*bright)); 17 | int randb = random(0,(25*bright)); 18 | int randi = random(1,strip.numPixels()); 19 | int randii = random(1,strip.numPixels()); 20 | colorWipe(randr, randg, randb, wait); 21 | } 22 | void colorWipe(int r, int g, int b, int wait) { 23 | for(int i=0; i 2 | 3 | #define PIN 5 4 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(212, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 5 | 6 | int bright = 10; //select 1 thru 10 7 | int wait = 1; //select delay on changing from one to another 8 | int wait2 = 1; //select speed of flashes in police 9 | int wait3 = .1; //select speed of color change 10 | int wait4 = .1; //select speed of larson 11 | int wait5 = 100; //select duration of light 12 | 13 | void setup() { 14 | strip.begin(); 15 | strip.show(); // Initialize all pixels to 'off' 16 | } 17 | void loop() { 18 | //this is the group of programs for the leds 19 | joker(wait); 20 | larson(wait); 21 | rainbow(wait3); 22 | police(wait2); 23 | roomlight(wait5); 24 | 25 | } 26 | 27 | void joker(int wait) { 28 | for(int d=0; d< 20 ; d++) { // how many times it flashe 29 | for(int i=0; i= strip.numPixels()) { 157 | pos = strip.numPixels() - 2; 158 | dir = -dir; 159 | } 160 | } 161 | } 162 | 163 | // Sine wave effect 164 | #define PI 3.14159265 165 | void wave(uint32_t c, int cycles, uint8_t wait) { 166 | float y; 167 | byte r, g, b, r2, g2, b2; 168 | 169 | // Need to decompose color into its r, g, b elements 170 | g = (c >> 16) & 0x7f; 171 | r = (c >> 8) & 0x7f; 172 | b = c & 0x7f; 173 | 174 | for(int x=0; x<(strip.numPixels()*5); x++) 175 | { 176 | for(int i=0; i= 0.0) { 179 | // Peaks of sine wave are white 180 | y = 1.0 - y; // Translate Y to 0.0 (top) to 1.0 (center) 181 | r2 = 127 - (byte)((float)(127 - r) * y); 182 | g2 = 127 - (byte)((float)(127 - g) * y); 183 | b2 = 127 - (byte)((float)(127 - b) * y); 184 | } else { 185 | // Troughs of sine wave are black 186 | y += 1.0; // Translate Y to 0.0 (bottom) to 1.0 (center) 187 | r2 = (byte)((float)r * y); 188 | g2 = (byte)((float)g * y); 189 | b2 = (byte)((float)b * y); 190 | } 191 | strip.setPixelColor(i, r2, g2, b2); 192 | } 193 | strip.show(); 194 | delay(wait); 195 | } 196 | } 197 | 198 | /* Helper functions */ 199 | 200 | //Input a value 0 to 384 to get a color value. 201 | //The colours are a transition r - g - b - back to r 202 | 203 | uint32_t Wheel(uint16_t WheelPos) 204 | { 205 | byte r, g, b; 206 | switch(WheelPos / 128) 207 | { 208 | case 0: 209 | r = 127 - WheelPos % 128; // red down 210 | g = WheelPos % 128; // green up 211 | b = 0; // blue off 212 | break; 213 | case 1: 214 | g = 127 - WheelPos % 128; // green down 215 | b = WheelPos % 128; // blue up 216 | r = 0; // red off 217 | break; 218 | case 2: 219 | b = 127 - WheelPos % 128; // blue down 220 | r = WheelPos % 128; // red up 221 | g = 0; // green off 222 | break; 223 | } 224 | return(strip.Color(r,g,b)); 225 | } 226 | -------------------------------------------------------------------------------- /neo_carprogram/neo_carprogram.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define PIN 6 4 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 5 | 6 | int bright = 10; //select 1 thru 10 7 | int wait = 110; //select delay on changing from one to another 8 | int wait2 = 100; //select speed of flashes in police 9 | int wait3 = 10; //select speed of color change 10 | int wait4 = 50; //select speed of larson 11 | 12 | void setup() { 13 | strip.begin(); 14 | strip.show(); // Initialize all pixels to 'off' 15 | } 16 | void loop() { 17 | //this is the group of programs for the leds 18 | joker(wait); 19 | race(wait); 20 | evil(wait); 21 | larson(wait); 22 | rainbow(wait2); 23 | police(wait2); 24 | caution(wait); 25 | strobe(wait); 26 | } 27 | 28 | void joker(int wait) { 29 | for(int i=0; i< wait ; i++) { 30 | strip.setPixelColor(0, 0, 250, 50); 31 | strip.setPixelColor(1, 250, 0, 100); 32 | strip.setPixelColor(2, 250, 0, 100); 33 | strip.setPixelColor(3, 0, 250, 50); 34 | strip.show(); 35 | delay(100); 36 | } 37 | } 38 | 39 | void police(int wait2) { 40 | 41 | for(int d=0; d< 20 ; d++) { // how many times it flashe 42 | strip.setPixelColor(0, 0, 0, 255); 43 | strip.setPixelColor(1, 255, 0, 0); 44 | strip.setPixelColor(2, 255, 0, 0); 45 | strip.setPixelColor(3, 0, 0, 255); 46 | strip.show(); 47 | delay(wait2); 48 | strip.setPixelColor(0, 255, 0, 0); 49 | strip.setPixelColor(1, 0, 0, 255); 50 | strip.setPixelColor(2, 0, 0, 255); 51 | strip.setPixelColor(3, 255, 0, 0); 52 | strip.show(); 53 | delay(wait2); 54 | strip.setPixelColor(0, 255, 255, 255); 55 | strip.setPixelColor(1, 255, 255, 255); 56 | strip.setPixelColor(2, 255, 255, 255); 57 | strip.setPixelColor(3, 255, 255, 255); 58 | strip.show(); 59 | delay(wait2); 60 | } 61 | } 62 | 63 | void race(int wait) { 64 | for(int i=0; i< wait ; i++) { 65 | strip.setPixelColor(0, 100, 100, 100); 66 | strip.setPixelColor(1, 100, 170, 0); 67 | strip.setPixelColor(2, 100, 170, 0); 68 | strip.setPixelColor(3, 100, 100, 100); 69 | strip.show(); 70 | delay(wait); 71 | } 72 | } 73 | void evil(int wait) { 74 | for(int i=0; i< wait ; i++) { 75 | strip.setPixelColor(0, 250, 0, 0); 76 | strip.setPixelColor(1, 250, 0, 0); 77 | strip.setPixelColor(2, 250, 0, 0); 78 | strip.setPixelColor(3, 250, 0, 0); 79 | strip.show(); 80 | delay(wait); 81 | } 82 | } 83 | void rainbow(uint8_t wait) { 84 | uint16_t i, j, d; 85 | for(d=0; d < 20; d++){ //this is how many times it will cycle the full rainbow 86 | for(j=0; j<256; j++) { 87 | for(i=0; i 2 | 3 | #define PIN 6 4 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 5 | 6 | int bright = 10; //select 1 thru 10 7 | int wait = 110; //select delay on changing from one to another 8 | int wait2 = 100; //select speed of flashes in police 9 | int wait3 = 10; //select speed of color change 10 | int wait4 = 50; //select speed of larson 11 | 12 | void setup() { 13 | strip.begin(); 14 | strip.show(); // Initialize all pixels to 'off' 15 | } 16 | void loop() { 17 | //this is the group of programs for the leds 18 | joker(wait); 19 | race(wait); 20 | evil(wait); 21 | larson(wait); 22 | rainbow(wait2); 23 | police(wait2); 24 | caution(wait); 25 | strobe(wait); 26 | } 27 | 28 | void joker(int wait) { 29 | for(int i=0; i< wait ; i++) { 30 | strip.setPixelColor(0, 0, 250, 50); 31 | strip.setPixelColor(1, 250, 0, 100); 32 | strip.setPixelColor(2, 250, 0, 100); 33 | strip.setPixelColor(3, 0, 250, 50); 34 | strip.show(); 35 | delay(100); 36 | } 37 | } 38 | 39 | void police(int wait2) { 40 | 41 | for(int d=0; d< 20 ; d++) { // how many times it flashe 42 | strip.setPixelColor(0, 0, 0, 255); 43 | strip.setPixelColor(1, 255, 0, 0); 44 | strip.setPixelColor(2, 255, 0, 0); 45 | strip.setPixelColor(3, 0, 0, 255); 46 | strip.show(); 47 | delay(wait2); 48 | strip.setPixelColor(0, 255, 0, 0); 49 | strip.setPixelColor(1, 0, 0, 255); 50 | strip.setPixelColor(2, 0, 0, 255); 51 | strip.setPixelColor(3, 255, 0, 0); 52 | strip.show(); 53 | delay(wait2); 54 | strip.setPixelColor(0, 255, 255, 255); 55 | strip.setPixelColor(1, 255, 255, 255); 56 | strip.setPixelColor(2, 255, 255, 255); 57 | strip.setPixelColor(3, 255, 255, 255); 58 | strip.show(); 59 | delay(wait2); 60 | } 61 | } 62 | 63 | void race(int wait) { 64 | for(int i=0; i< wait ; i++) { 65 | strip.setPixelColor(0, 100, 100, 100); 66 | strip.setPixelColor(1, 100, 170, 0); 67 | strip.setPixelColor(2, 100, 170, 0); 68 | strip.setPixelColor(3, 100, 100, 100); 69 | strip.show(); 70 | delay(wait); 71 | } 72 | } 73 | void evil(int wait) { 74 | for(int i=0; i< wait ; i++) { 75 | strip.setPixelColor(0, 250, 0, 0); 76 | strip.setPixelColor(1, 250, 0, 0); 77 | strip.setPixelColor(2, 250, 0, 0); 78 | strip.setPixelColor(3, 250, 0, 0); 79 | strip.show(); 80 | delay(wait); 81 | } 82 | } 83 | void rainbow(uint8_t wait) { 84 | uint16_t i, j, d; 85 | for(d=0; d < 20; d++){ //this is how many times it will cycle the full rainbow 86 | for(j=0; j<256; j++) { 87 | for(i=0; i 2 | 3 | #define PIN 6 4 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(7, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 5 | 6 | int bright = 9; //select 1 thru 10 7 | int wait = 110; //select delay on changing from one to another 8 | int wait2 = 100; //select speed of flashes in police 9 | int wait3 = 10; //select speed of color change 10 | int wait4 = 50; //select speed of larson 11 | 12 | void setup() { 13 | strip.begin(); 14 | strip.show(); // Initialize all pixels to 'off' 15 | } 16 | void loop() { 17 | //this is the group of programs for the leds 18 | joker(wait); 19 | race(wait); 20 | evil(wait); 21 | larson(wait); 22 | rainbow(wait2); 23 | police(wait2); 24 | caution(wait); 25 | strobe(wait); 26 | } 27 | 28 | void joker(int wait) { 29 | for(int i=0; i< wait ; i++) { 30 | strip.setPixelColor(0, 0, 250, 50); 31 | strip.setPixelColor(1, 250, 0, 100); 32 | strip.setPixelColor(2, 250, 0, 100); 33 | strip.setPixelColor(3, 0, 250, 50); 34 | strip.show(); 35 | delay(100); 36 | } 37 | } 38 | 39 | void police(int wait2) { 40 | 41 | for(int d=0; d< 20 ; d++) { // how many times it flashe 42 | strip.setPixelColor(0, 0, 0, 255); 43 | strip.setPixelColor(1, 255, 0, 0); 44 | strip.setPixelColor(2, 255, 0, 0); 45 | strip.setPixelColor(3, 0, 0, 255); 46 | strip.show(); 47 | delay(wait2); 48 | strip.setPixelColor(0, 255, 0, 0); 49 | strip.setPixelColor(1, 0, 0, 255); 50 | strip.setPixelColor(2, 0, 0, 255); 51 | strip.setPixelColor(3, 255, 0, 0); 52 | strip.show(); 53 | delay(wait2); 54 | strip.setPixelColor(0, 255, 255, 255); 55 | strip.setPixelColor(1, 255, 255, 255); 56 | strip.setPixelColor(2, 255, 255, 255); 57 | strip.setPixelColor(3, 255, 255, 255); 58 | strip.show(); 59 | delay(wait2); 60 | } 61 | } 62 | 63 | void race(int wait) { 64 | for(int i=0; i< wait ; i++) { 65 | strip.setPixelColor(0, 100, 100, 100); 66 | strip.setPixelColor(1, 100, 170, 0); 67 | strip.setPixelColor(2, 100, 170, 0); 68 | strip.setPixelColor(3, 100, 100, 100); 69 | strip.show(); 70 | delay(wait); 71 | } 72 | } 73 | void evil(int wait) { 74 | for(int i=0; i< wait ; i++) { 75 | strip.setPixelColor(0, 250, 0, 0); 76 | strip.setPixelColor(1, 250, 0, 0); 77 | strip.setPixelColor(2, 250, 0, 0); 78 | strip.setPixelColor(3, 250, 0, 0); 79 | strip.show(); 80 | delay(wait); 81 | } 82 | } 83 | void rainbow(uint8_t wait) { 84 | uint16_t i, j, d; 85 | for(d=0; d < 20; d++){ //this is how many times it will cycle the full rainbow 86 | for(j=0; j<256; j++) { 87 | for(i=0; i 2 | 3 | #define PIN 6 4 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(7, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 5 | 6 | int bright = 9; //select 1 thru 10 7 | int wait = 110; //select delay on changing from one to another 8 | int wait2 = 100; //select speed of flashes in police 9 | int wait3 = 10; //select speed of color change 10 | int wait4 = 50; //select speed of larson 11 | 12 | void setup() { 13 | strip.begin(); 14 | strip.show(); // Initialize all pixels to 'off' 15 | } 16 | void loop() { 17 | //this is the group of programs for the leds 18 | joker(wait); 19 | race(wait); 20 | evil(wait); 21 | larson(wait); 22 | rainbow(wait2); 23 | police(wait2); 24 | caution(wait); 25 | strobe(wait); 26 | } 27 | 28 | void joker(int wait) { 29 | for(int i=0; i< wait ; i++) { 30 | strip.setPixelColor(0, 0, 250, 50); 31 | strip.setPixelColor(1, 250, 0, 100); 32 | strip.setPixelColor(2, 250, 0, 100); 33 | strip.setPixelColor(3, 0, 250, 50); 34 | strip.show(); 35 | delay(100); 36 | } 37 | } 38 | 39 | void police(int wait2) { 40 | 41 | for(int d=0; d< 20 ; d++) { // how many times it flashe 42 | strip.setPixelColor(0, 0, 0, 255); 43 | strip.setPixelColor(1, 255, 0, 0); 44 | strip.setPixelColor(2, 255, 0, 0); 45 | strip.setPixelColor(3, 0, 0, 255); 46 | strip.show(); 47 | delay(wait2); 48 | strip.setPixelColor(0, 255, 0, 0); 49 | strip.setPixelColor(1, 0, 0, 255); 50 | strip.setPixelColor(2, 0, 0, 255); 51 | strip.setPixelColor(3, 255, 0, 0); 52 | strip.show(); 53 | delay(wait2); 54 | strip.setPixelColor(0, 255, 255, 255); 55 | strip.setPixelColor(1, 255, 255, 255); 56 | strip.setPixelColor(2, 255, 255, 255); 57 | strip.setPixelColor(3, 255, 255, 255); 58 | strip.show(); 59 | delay(wait2); 60 | } 61 | } 62 | 63 | void race(int wait) { 64 | for(int i=0; i< wait ; i++) { 65 | strip.setPixelColor(0, 100, 100, 100); 66 | strip.setPixelColor(1, 100, 170, 0); 67 | strip.setPixelColor(2, 100, 170, 0); 68 | strip.setPixelColor(3, 100, 100, 100); 69 | strip.show(); 70 | delay(wait); 71 | } 72 | } 73 | void evil(int wait) { 74 | for(int i=0; i< wait ; i++) { 75 | strip.setPixelColor(0, 250, 0, 0); 76 | strip.setPixelColor(1, 250, 0, 0); 77 | strip.setPixelColor(2, 250, 0, 0); 78 | strip.setPixelColor(3, 250, 0, 0); 79 | strip.show(); 80 | delay(wait); 81 | } 82 | } 83 | void rainbow(uint8_t wait) { 84 | uint16_t i, j, d; 85 | for(d=0; d < 20; d++){ //this is how many times it will cycle the full rainbow 86 | for(j=0; j<256; j++) { 87 | for(i=0; i= strip.numPixels()) { 187 | pos = strip.numPixels() - 2; 188 | dir = -dir; 189 | } 190 | } 191 | } 192 | 193 | // Sine wave effect 194 | #define PI 3.14159265 195 | void wave(uint32_t c, int cycles, uint8_t wait) { 196 | float y; 197 | byte r, g, b, r2, g2, b2; 198 | 199 | // Need to decompose color into its r, g, b elements 200 | g = (c >> 16) & 0x7f; 201 | r = (c >> 8) & 0x7f; 202 | b = c & 0x7f; 203 | 204 | for(int x=0; x<(strip.numPixels()*5); x++) 205 | { 206 | for(int i=0; i= 0.0) { 209 | // Peaks of sine wave are white 210 | y = 1.0 - y; // Translate Y to 0.0 (top) to 1.0 (center) 211 | r2 = 127 - (byte)((float)(127 - r) * y); 212 | g2 = 127 - (byte)((float)(127 - g) * y); 213 | b2 = 127 - (byte)((float)(127 - b) * y); 214 | } else { 215 | // Troughs of sine wave are black 216 | y += 1.0; // Translate Y to 0.0 (bottom) to 1.0 (center) 217 | r2 = (byte)((float)r * y); 218 | g2 = (byte)((float)g * y); 219 | b2 = (byte)((float)b * y); 220 | } 221 | strip.setPixelColor(i, r2, g2, b2); 222 | } 223 | strip.show(); 224 | delay(wait); 225 | } 226 | } 227 | 228 | /* Helper functions */ 229 | 230 | //Input a value 0 to 384 to get a color value. 231 | //The colours are a transition r - g - b - back to r 232 | 233 | uint32_t Wheel(uint16_t WheelPos) 234 | { 235 | byte r, g, b; 236 | switch(WheelPos / 128) 237 | { 238 | case 0: 239 | r = 127 - WheelPos % 128; // red down 240 | g = WheelPos % 128; // green up 241 | b = 0; // blue off 242 | break; 243 | case 1: 244 | g = 127 - WheelPos % 128; // green down 245 | b = WheelPos % 128; // blue up 246 | r = 0; // red off 247 | break; 248 | case 2: 249 | b = 127 - WheelPos % 128; // blue down 250 | r = WheelPos % 128; // red up 251 | g = 0; // green off 252 | break; 253 | } 254 | return(strip.Color(r,g,b)); 255 | } 256 | -------------------------------------------------------------------------------- /soundNeo/soundNeo.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define PIN 5 4 | 5 | Adafruit_NeoPixel strip = Adafruit_NeoPixel(185, PIN, NEO_GRB + NEO_KHZ800); //first number controls the amount of pixels you have (add 4 so the drip falls off the edge) 6 | 7 | int bright = 1; //select 1 thru 10 8 | int wait = 0;//20; //speed of leds 9 | 10 | //values for MSGEQ7 Chip 11 | int analogPin = 0; // read from multiplexer using analog input 0 12 | int strobePin = 2; // strobe is attached to digital pin 2 13 | int resetPin = 3; // reset is attached to digital pin 3 14 | int spectrumValue[7]; // to hold a2d values 15 | //int j =0; 16 | 17 | int disablePin = 7; //pin to send 0s to output 18 | 19 | uint32_t beginTime = 0; 20 | uint32_t endTime = 0; 21 | 22 | void setup() { 23 | strip.begin(); 24 | strip.show(); // Initialize all pixels to 'off' 25 | 26 | pinMode(disablePin, INPUT); 27 | digitalWrite(disablePin, HIGH); //Turn on pull up resistors 28 | 29 | pinMode(analogPin, INPUT); 30 | pinMode(strobePin, OUTPUT); 31 | pinMode(resetPin, OUTPUT); 32 | analogReference(DEFAULT); 33 | digitalWrite(resetPin, LOW); 34 | digitalWrite(strobePin, HIGH); 35 | // Serial.println("MSGEQ7 test by J Skoba"); 36 | 37 | } 38 | void loop() { 39 | 40 | beginTime = millis(); 41 | while ( (millis()-beginTime) <= 60000) 42 | vuMeter_2(); 43 | 44 | beginTime = millis(); 45 | while ( (millis()-beginTime) <= 60000) 46 | vuMeter(); 47 | 48 | beginTime = millis(); 49 | while ( (millis()-beginTime) <= 60000) 50 | musicRainbowLoop_1(); 51 | 52 | /* beginTime = millis(); 53 | while ( (millis()-beginTime) <= 60000) 54 | musicRainbowLoop_2();*/ 55 | } 56 | 57 | void musicRainbowLoop_1(){ 58 | 59 | int i = 0, j= 0; 60 | 61 | digitalWrite(resetPin, HIGH); 62 | digitalWrite(resetPin, LOW); 63 | 64 | //grabs readings from chip 65 | for (i = 0; i < 7; i++) 66 | { 67 | digitalWrite(strobePin, LOW); 68 | // delayMicroseconds(30); // to allow the output to settle 69 | spectrumValue[i] = analogRead(analogPin); 70 | 71 | digitalWrite(strobePin, HIGH); 72 | 73 | //makes 10 bit value 8 bit 74 | spectrumValue[i] /= 4; 75 | 76 | if(spectrumValue[i] > 255) 77 | spectrumValue[i] = 255; 78 | 79 | for (j=0; j<27; j++) 80 | { 81 | if (spectrumValue[i] <= 55) 82 | spectrumValue[i] = 0; 83 | if (i == 0) 84 | nextLed(spectrumValue[i], 0,0, wait); 85 | else if (i == 1) 86 | nextLed(0, spectrumValue[i], 0, wait); 87 | else if (i == 2) 88 | nextLed(0,0, spectrumValue[i], wait); 89 | else if (i == 3) 90 | nextLed(spectrumValue[i], 0, spectrumValue[i], wait); 91 | else if (i == 4) 92 | nextLed(0, spectrumValue[i], spectrumValue[i], wait); 93 | else if (i == 5) 94 | nextLed(spectrumValue[i], spectrumValue[i],0, wait); 95 | else 96 | nextLed(spectrumValue[i], spectrumValue[i], spectrumValue[i], wait); 97 | } 98 | delay(2); 99 | } 100 | } 101 | 102 | void musicRainbowLoop_2(){ 103 | int i; 104 | int loopEnd; 105 | 106 | digitalWrite(resetPin, HIGH); 107 | digitalWrite(resetPin, LOW); 108 | 109 | //grabs readings from chip 110 | for (i = 0; i < 7; i++) 111 | { 112 | digitalWrite(strobePin, LOW); 113 | // delayMicroseconds(30); // to allow the output to settle 114 | spectrumValue[i] = analogRead(analogPin); 115 | 116 | digitalWrite(strobePin, HIGH); 117 | 118 | //makes 10 bit value 8 bit 119 | spectrumValue[i] /= 4; 120 | 121 | if(spectrumValue[i] > 255) 122 | spectrumValue[i] = 255; 123 | 124 | if (spectrumValue[i] >= 40) 125 | spectrumValue[i] = 0; 126 | } 127 | 128 | loopEnd = 27; 129 | for (i = 0;i 255) 191 | spectrumValue[i] = 255; 192 | 193 | /*if (spectrumValue[i] >= 40) 194 | spectrumValue[i] = 0;*/ 195 | } 196 | 197 | 198 | 199 | for (i = 0;inumPixels-spectrumValue[0] && i>0; i--) 231 | strip.setPixelColor(i, 255, 0, 0); 232 | 233 | loopEnd = i - spectrumValue[1]; 234 | for (;i>loopEnd && i>0; i--) 235 | strip.setPixelColor(i,0, 255, 0); 236 | 237 | loopEnd = i - spectrumValue[2]; 238 | for (;i>loopEnd && i>0; i--) 239 | strip.setPixelColor(i,0,0, 255); 240 | 241 | loopEnd = i - spectrumValue[3]; 242 | for (;i>loopEnd && i>0; i--) 243 | strip.setPixelColor(i,255, 0,255); 244 | 245 | loopEnd = i - spectrumValue[4]; 246 | for (;i>loopEnd && i>0; i--) 247 | strip.setPixelColor(i,255, 255, 0); 248 | 249 | loopEnd = i - spectrumValue[5]; 250 | for (;i>loopEnd && i>0; i--) 251 | strip.setPixelColor(i,255, 128, 0); 252 | 253 | loopEnd = i - spectrumValue[6]; 254 | for (;i>loopEnd && i>0; i--) 255 | strip.setPixelColor(i,255,255,255); 256 | 257 | strip.show(); 258 | 259 | } 260 | 261 | 262 | void musicRainbowLoop_3(){ 263 | 264 | int i = 0, j= 0; 265 | 266 | digitalWrite(resetPin, HIGH); 267 | digitalWrite(resetPin, LOW); 268 | 269 | //grabs readings from chip 270 | for (i = 0; i < 7; i++) 271 | { 272 | digitalWrite(strobePin, LOW); 273 | // delayMicroseconds(30); // to allow the output to settle 274 | spectrumValue[i] = analogRead(analogPin); 275 | 276 | digitalWrite(strobePin, HIGH); 277 | 278 | //makes 10 bit value 8 bit 279 | spectrumValue[i] /= 4; 280 | 281 | if(spectrumValue[i] > 255) 282 | spectrumValue[i] = 255; 283 | 284 | if (spectrumValue[i] <= 55) 285 | spectrumValue[i] = 0; 286 | 287 | spectrumValue[i] = (int)(spectrumValue[i] / 7); 288 | 289 | 290 | for (j=0; j<27; j++) 291 | { 292 | if (i == 0 && spectrumValue[i] >=j) 293 | nextLed(spectrumValue[i], 0,0, wait); 294 | else if (i == 1 && spectrumValue[i] >=j) 295 | nextLed(0, 255, 0, wait); 296 | else if (i == 2 && spectrumValue[i] >=j) 297 | nextLed(0,0, 255, wait); 298 | else if (i == 3 && spectrumValue[i] >=j) 299 | nextLed(255, 0, 255, wait); 300 | else if (i == 4 && spectrumValue[i] >=j) 301 | nextLed(0, 255,255, wait); 302 | else if (i == 5 && spectrumValue[i] >=j) 303 | nextLed(255, 255,0, wait); 304 | else if (i == 6 && spectrumValue[i] >=j) 305 | nextLed(255,255,255, wait); 306 | else 307 | nextLed(0,0,0, wait); 308 | } 309 | delay(2); 310 | } 311 | } 312 | 313 | 314 | 315 | void vuMeter_2(){ 316 | 317 | int i = 0, j= 0,k =0; 318 | 319 | digitalWrite(resetPin, HIGH); 320 | digitalWrite(resetPin, LOW); 321 | 322 | //grabs readings from chip 323 | for (i = 0; i < 7; i++) 324 | { 325 | digitalWrite(strobePin, LOW); 326 | // delayMicroseconds(30); // to allow the output to settle 327 | spectrumValue[i] = analogRead(analogPin); 328 | 329 | digitalWrite(strobePin, HIGH); 330 | 331 | //makes 10 bit value 8 bit 332 | spectrumValue[i] /= 4; 333 | 334 | if(spectrumValue[i] > 255) 335 | spectrumValue[i] = 255; 336 | 337 | if (spectrumValue[i] <= 55) 338 | spectrumValue[i] = 0; 339 | 340 | spectrumValue[i] = (int)(spectrumValue[i] / 7); 341 | 342 | if (i == 0) 343 | spectrumValue[i] *= 1.5; 344 | else 345 | spectrumValue[i] *= 1.2; 346 | 347 | 348 | 349 | 350 | for (j=0; j<27; j++) 351 | { 352 | if (i == 0 && spectrumValue[i] >=j) 353 | strip.setPixelColor(k++,255, 0,0); 354 | else if (i == 1 && spectrumValue[i] >=j) 355 | strip.setPixelColor(k++,0, 255, 0); 356 | else if (i == 2 && spectrumValue[i] >=j) 357 | strip.setPixelColor(k++,0,0, 255); 358 | else if (i == 3 && spectrumValue[i] >=j) 359 | strip.setPixelColor(k++,255, 0, 255); 360 | else if (i == 4 && spectrumValue[i] >=j) 361 | strip.setPixelColor(k++,0, 255,255); 362 | else if (i == 5 && spectrumValue[i] >=j) 363 | strip.setPixelColor(k++,255, 255,0); 364 | else if (i == 6 && spectrumValue[i] >=j) 365 | strip.setPixelColor(k++,255,255,255); 366 | else 367 | strip.setPixelColor(k++,0,0,0); 368 | } 369 | delay(2); 370 | } 371 | 372 | strip.show(); 373 | } 374 | 375 | 376 | 377 | void nextLed(int r, int g, int b, int wait){ 378 | static int currentLed = 0; 379 | 380 | 381 | strip.setPixelColor(currentLed, r, g, b); 382 | delay(wait); 383 | 384 | //if (currentLed % 4 == 0) 385 | // strip.show(); 386 | 387 | currentLed++; 388 | // currentLed += 4; 389 | 390 | if (currentLed >= strip.numPixels() ){ 391 | currentLed = 0; 392 | strip.show(); 393 | } 394 | 395 | } 396 | --------------------------------------------------------------------------------