Last active
November 8, 2017 17:01
-
-
Save aschle/0251ed73d06ccf7ed29a4faab128a30b to your computer and use it in GitHub Desktop.
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
#include <Adafruit_NeoPixel.h> | |
#define PIN 6 | |
#define NUMPIXELS 49 | |
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); | |
void setup () { | |
pixels.begin(); | |
//for(int x = 0; x < 49; x++) { | |
//pixels.setPixelColor(x, pixels.Color(255,150,0)); | |
//pixels.setPixelColor(x-1, 0); | |
//pixels.show(); | |
//delay(25); | |
//} | |
} | |
void loop() { | |
uint32_t green = pixels.Color(154,232,12); | |
uint32_t yellow = pixels.Color(254,255,0); | |
uint32_t red = pixels.Color(204,24,20); | |
full(red, 18000); | |
heart(yellow, 1200); | |
full(red, 18000); | |
names(green, 1200); | |
full(red, 18000); | |
heart(green, 1200); | |
full(red, 18000); | |
names(yellow, 1200); | |
} | |
static void full(uint32_t c, int del){ | |
all(c); | |
delay(del); | |
all(0); | |
} | |
static void names(uint32_t c, int del){ | |
// A | |
setLED(c,10); | |
setLED(c,18); | |
setLED(c,20); | |
setLED(c,29); | |
setLED(c,28); | |
setLED(c,27); | |
setLED(c,35); | |
setLED(c,43); | |
setLED(c,41); | |
setLED(c,37); | |
pixels.show(); | |
delay(del); | |
setLED(0,10); | |
setLED(0,18); | |
setLED(0,20); | |
setLED(0,29); | |
setLED(0,28); | |
setLED(0,27); | |
setLED(0,35); | |
setLED(0,43); | |
setLED(0,41); | |
setLED(0,37); | |
pixels.show(); | |
delay(del); | |
// + | |
setLED(c,19); | |
setLED(c,29); | |
setLED(c,28); | |
setLED(c,27); | |
setLED(c,36); | |
pixels.show(); | |
delay(del); | |
setLED(0,19); | |
setLED(0,29); | |
setLED(0,28); | |
setLED(0,27); | |
setLED(0,36); | |
pixels.show(); | |
delay(del); | |
// I | |
setLED(c,10); | |
setLED(c,19); | |
setLED(c,28); | |
setLED(c,36); | |
setLED(c,42); | |
pixels.show(); | |
delay(del); | |
setLED(0,10); | |
setLED(0,19); | |
setLED(0,28); | |
setLED(0,36); | |
setLED(0,42); | |
pixels.show(); | |
delay(del); | |
// = | |
setLED(c,18); | |
setLED(c,19); | |
setLED(c,20); | |
setLED(c,35); | |
setLED(c,36); | |
setLED(c,37); | |
pixels.show(); | |
delay(del); | |
setLED(0,18); | |
setLED(0,19); | |
setLED(0,20); | |
setLED(0,35); | |
setLED(0,36); | |
setLED(0,37); | |
pixels.show(); | |
delay(del); | |
for (int i = 0; i < 3; i++){ | |
all(c); | |
delay(del); | |
all(0); | |
delay(del); | |
} | |
} | |
static void setLED(uint32_t c, int led){ | |
pixels.setPixelColor(led,c); | |
} | |
static void all(uint32_t c){ | |
for (int x = 0; x < 49; x++){ | |
setLED(c,x); | |
} | |
pixels.show(); | |
} | |
static void heart(uint32_t c, int del){ | |
int first[] = {36,29,27}; | |
for (int fi = 0; fi < 3; fi++){ | |
setLED(c, first[fi]); | |
} | |
pixels.show(); | |
delay(del); | |
int second[] = {42,37,26,21,20,28,18,17,30,35}; | |
for (int se = 0; se < 10; se++){ | |
setLED(c, second[se]); | |
} | |
pixels.show(); | |
delay(del); | |
int third[] = {46,41,38,25, 22,8,9,19,11,12, 16,31,34,43}; | |
for (int th = 0; th < 14; th++){ | |
setLED(c, third[th]); | |
} | |
pixels.show(); | |
delay(del); | |
int last[] = {48,47,40,39,24,23,6,5,4,3,2,1,0,14,15,32,33,44,45,10,13,7}; | |
for (int la = 0; la < 22; la++){ | |
setLED(c, last[la]); | |
} | |
pixels.show(); | |
delay(del); | |
for (int la = 0; la < 22; la++){ | |
setLED(0, last[la]); | |
} | |
pixels.show(); | |
delay(del); | |
for (int th = 0; th < 14; th++){ | |
setLED(0, third[th]); | |
} | |
pixels.show(); | |
delay(del); | |
for (int se = 0; se < 10; se++){ | |
setLED(0, second[se]); | |
} | |
pixels.show(); | |
delay(del); | |
for (int fi = 0; fi < 3; fi++){ | |
setLED(0, first[fi]); | |
} | |
pixels.show(); | |
delay(del); | |
all(0); | |
} | |
static void test(uint32_t c){ | |
pixels.setPixelColor(5, c); | |
pixels.show(); | |
delay(600); | |
pixels.setPixelColor(5, 0); | |
pixels.show(); | |
delay(600); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment