added new defines in header and comments for hardcoded values in functions
This commit is contained in:
parent
fc1b9271e8
commit
7b5a054455
|
@ -26,9 +26,12 @@
|
||||||
#define CLIENT_SSL_ENABLE
|
#define CLIENT_SSL_ENABLE
|
||||||
|
|
||||||
//Adafruit_NeoPixel Stuff
|
//Adafruit_NeoPixel Stuff
|
||||||
#define PIN 2
|
#define PIN 2 //if you are using ESP-01
|
||||||
#define NUMPIXELS <number_of_leds>
|
#define NUMPIXELS "<number_of_leds>" //in my case 72
|
||||||
#define BRIGHTNESS 50
|
#define BRIGHTNESS 50
|
||||||
|
#define COLOR_COMBINATIONS "<number_of_color_combinations>" //in my case 6
|
||||||
|
#define LINES_IN_STRIP "<number_of_lines_per_strip>" //in my case 9
|
||||||
|
#define LEDS_PER_LINE "<number of_leds_per_line>" //in my case 8
|
||||||
// RGB NeoPixel permutations; white and red offsets are always same
|
// RGB NeoPixel permutations; white and red offsets are always same
|
||||||
// Offset: W R G B
|
// Offset: W R G B
|
||||||
#define NEO_GRB ((1 << 6) | (1 << 4) | (0 << 2) | (2))
|
#define NEO_GRB ((1 << 6) | (1 << 4) | (0 << 2) | (2))
|
||||||
|
|
|
@ -282,13 +282,15 @@ void set_rainbow_element(uint8_t element_num, uint8_t red, uint8_t green, uint8_
|
||||||
rainbow_array[element_num].b.blue = green;
|
rainbow_array[element_num].b.blue = green;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_rainbow_array(){
|
void init_rainbow_array() { // it is important to rework this function if the
|
||||||
set_rainbow_element(0, 0, 0, 255); //blue
|
// desired color combination array doesn't have 6
|
||||||
set_rainbow_element(1, 255, 0, 255); //purple
|
// elements
|
||||||
set_rainbow_element(2, 255, 0, 0); //red
|
set_rainbow_element(0, 0, 0, 255); // blue
|
||||||
set_rainbow_element(3, 255, 255, 0); //orange
|
set_rainbow_element(1, 255, 0, 255); // purple
|
||||||
set_rainbow_element(4, 0, 255, 0); //green
|
set_rainbow_element(2, 255, 0, 0); // red
|
||||||
set_rainbow_element(5, 0, 255, 255); //teal
|
set_rainbow_element(3, 255, 255, 0); // orange
|
||||||
|
set_rainbow_element(4, 0, 255, 0); // green
|
||||||
|
set_rainbow_element(5, 0, 255, 255); // teal
|
||||||
}
|
}
|
||||||
|
|
||||||
void rotate_rainbow_array(){
|
void rotate_rainbow_array(){
|
||||||
|
@ -299,7 +301,9 @@ void rotate_rainbow_array(){
|
||||||
rainbow_array[COLOR_COMBINATIONS-1] = temp;
|
rainbow_array[COLOR_COMBINATIONS-1] = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ledstrip_remap() {
|
void ledstrip_remap() { // it is important to rework this function if the total
|
||||||
|
// number of leds in your strip is not 72 (arranged in 9
|
||||||
|
// lines x 8 elements each)
|
||||||
// 1st ring
|
// 1st ring
|
||||||
myledstrip.LED_LINES_IN_STRIP[0].LED_LINE_ELEMENTS[0] =
|
myledstrip.LED_LINES_IN_STRIP[0].LED_LINE_ELEMENTS[0] =
|
||||||
&all_leds.LED_ARRAY[0];
|
&all_leds.LED_ARRAY[0];
|
||||||
|
|
Loading…
Reference in New Issue