-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestPattern.cpp
61 lines (48 loc) · 1.34 KB
/
TestPattern.cpp
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
56
57
58
59
//
// TestPattern.cpp
// GauntletII
//
// Created by Robert Atkins on 26/09/13.
// Copyright (c) 2013 Robert Atkins. All rights reserved.
//
#import "Effect.h"
class TestPattern : public Effect {
public:
TestPattern(CRGB *leds, int width, int height): Effect(leds, width, height) {
}
void start() {
// Serial.print("Hello, white!");
// chasePixels(CRGB::White);
Serial.print("Hello, red!");
chasePixels(CRGB::Red);
//
Serial.print("Hello, green!");
chasePixels(CRGB::Green);
//
Serial.print("Hello, blue!");
chasePixels(CRGB::Blue);
// blockPixels(CRGB::Red);
// blockPixels(CRGB::Green);
// blockPixels(CRGB::Blue);
//
// for (int i = 0; i < 256; i += 16) {
// blockPixels(CRGB::White, i);
// }
// blockPixels(CRGB::White);
}
void chasePixels(CRGB colour) {
for (int pixel = 0; pixel < width * height; pixel++) {
leds[pixel] = colour;
LEDS.show();
leds[pixel] = CRGB::Black;
}
}
void blockPixels(CRGB color) {
LEDS.showColor(color);
delay(2000);
}
void blockPixels(CRGB color, byte intensity) {
LEDS.showColor(color, intensity);
delay(2000);
}
};