-
Notifications
You must be signed in to change notification settings - Fork 2
/
neoheart.ino
55 lines (47 loc) · 1.13 KB
/
neoheart.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <Adafruit_NeoPixel.h>
#define PIN 1
Adafruit_NeoPixel strip = Adafruit_NeoPixel(3, PIN, NEO_GRB + NEO_KHZ800);
int greeno;
int redo;
int blueo;
void setup() {
strip.begin();
strip.show();
}
void loop() {
// all pixels show the same color:
redo =random(255);
greeno = random(255);
blueo = random (255);
strip.setPixelColor(0, redo, greeno, blueo);
strip.setPixelColor(1, redo, greeno, blueo);
strip.setPixelColor(2, redo, greeno, blueo);
strip.show();
delay (20);
int x = 3;
for (int ii = 1 ; ii <252 ; ii = ii = ii + x){
strip.setBrightness(ii);
strip.show();
delay(5);
}
x = 3;
for (int ii = 252 ; ii > 3 ; ii = ii - x){
strip.setBrightness(ii);
strip.show();
delay(3);
}
delay(10);
x = 6;
for (int ii = 1 ; ii <255 ; ii = ii = ii + x){
strip.setBrightness(ii);
strip.show();
delay(2);
}
x = 6;
for (int ii = 255 ; ii > 1 ; ii = ii - x){
strip.setBrightness(ii);
strip.show();
delay(3);
}
delay (50);
}