-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfastspi_strip.h
77 lines (68 loc) · 2.96 KB
/
fastspi_strip.h
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <FastSPI_LED2.h>
class fastspi_strip {
int BOTTOM_INDEX;
int TOP_INDEX;
int EVENODD;
int num_leds;
int** ledsX;
int effectNumber;
int idex; //-LED INDEX (0 to num_leds-1
int ihue; //-HUE (0-360)
int ibright; //-BRIGHTNESS (0-255)
int isat; //-SATURATION (0-255)
int bouncedirection; //-SWITCH FOR COLOR BOUNCE (0-1)
int lcount;
float tcount;
/* Convenience functions */
int horizontal_index(int i);
int antipodal_index(int i);
int adjacent_cw(int i);
int adjacent_ccw(int i);
void HSVtoRGB(int hue, int sat, int val, int colors[3]);
void copy_led_array();
void print_led_arrays(int ilen);
public:
struct CRGB* leds;
fastspi_strip(int n);
void clear();
void loop();
void set_effect(int num);
void next();
void prev();
void set_color_led(int adex, int cred, int cgrn, int cblu);
void set_color_led(int adex, CRGB& color);
void one_color_all(int cred, int cgrn, int cblu) ; //-SET ALL LEDS TO ONE COLOR
void one_color_allNOSHOW(int cred, int cgrn, int cblu) ; //-SET ALL LEDS TO ONE COLOR
/* Lighting Effects */
void rainbow_strobe(int idelay) ;
void rainbow_fade(int idelay) ; //-FADE ALL LEDS THROUGH HSV RAINBOW
void rainbow_loop(int istep, int idelay) ; //-LOOP HSV RAINBOW
void random_burst(int idelay) ; //-RANDOM INDEX/COLOR
void color_bounce(int idelay) ; //-BOUNCE COLOR (SINGLE LED)
void police_lightsONE(int idelay) ; //-POLICE LIGHTS (TWO COLOR SINGLE LED)
void police_lightsALL(int idelay) ; //-POLICE LIGHTS (TWO COLOR SOLID)
void color_bounceFADE(int idelay) ; //-BOUNCE COLOR (SIMPLE MULTI-LED FADE)
void flicker(int thishue, int thissat) ;
void flash(CRGB color, int times, int d);
void pulse_one_color_all(int ahue, int idelay) ; //-PULSE BRIGHTNESS ON ALL LEDS TO ONE COLOR
void pulse_one_color_all_rev(int ahue, int idelay) ; //-PULSE SATURATION ON ALL LEDS TO ONE COLOR
void random_red() ; //QUICK 'N DIRTY RANDOMIZE TO GET CELL AUTOMATA STARTED
void rule30(int idelay) ; //1D CELLULAR AUTOMATA - RULE 30 (RED FOR NOW)
void random_march(int idelay) ; //RANDOM MARCH CCW
void rwb_march(int idelay) ; //R,W,B MARCH CCW
void white_temps() ;
void color_loop_vardelay(int iperiod, int idelay) ; //-COLOR LOOP (SINGLE LED) w/ VARIABLE DELAY
void pop_random(int ahue, int idelay) ;
void pop_horizontal(int ahue, int idelay) ; //-POP FROM LEFT TO RIGHT UP THE RING
void quad_bright_curve(int ahue, int idelay) ; //-QUADRATIC BRIGHTNESS CURVER
void flame() ;
void radiation(int ahue, int idelay) ; //-SORT OF RADIATION SYMBOLISH-
void sin_bright_wave(int ahue, int idelay) ;
void fade_vertical(int ahue, int idelay) ; //-FADE 'UP' THE LOOP
void rainbow_vertical(int istep, int idelay) ; //-RAINBOW 'UP' THE LOOP
void pacman(int idelay) ; //-MARCH STRIP C-W
void beat_march(int iwidth) ;
void strip_march_cw(int idelay) ; //-MARCH STRIP C-W
void strip_march_ccw(int idelay) ; //-MARCH STRIP C-W
void strip_march_iw();
};