|
@@ -23,8 +23,8 @@ const uint8_t led_assignments[leds_per_digit] = { 1, 9, 4, 6, 255, 7, 3, 0, 2, 8
|
|
|
const uint8_t x_offsets[leds_per_digit] = { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5 };
|
|
const uint8_t x_offsets[leds_per_digit] = { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5 };
|
|
|
uint8_t max_x_pos = 0;
|
|
uint8_t max_x_pos = 0;
|
|
|
|
|
|
|
|
-CRGB *color_on;
|
|
|
|
|
-CRGB *color_off;
|
|
|
|
|
|
|
+CRGB *col_on;
|
|
|
|
|
+CRGB *col_off;
|
|
|
|
|
|
|
|
uint8_t *led_mask_0;
|
|
uint8_t *led_mask_0;
|
|
|
uint8_t *led_mask_1;
|
|
uint8_t *led_mask_1;
|
|
@@ -34,10 +34,15 @@ float mask_fader = 0.0;
|
|
|
float mask_push = 1.0;
|
|
float mask_push = 1.0;
|
|
|
bool mask_fade_finished = false;
|
|
bool mask_fade_finished = false;
|
|
|
|
|
|
|
|
-uint8_t transition_type = CROSSFADE;
|
|
|
|
|
|
|
+uint8_t trans_type = CROSSFADE;
|
|
|
|
|
+uint16_t trans_time = 250;
|
|
|
bool transition_mid_point = true;
|
|
bool transition_mid_point = true;
|
|
|
|
|
|
|
|
-Ticker lixie_animation;
|
|
|
|
|
|
|
+bool background_updates = true;
|
|
|
|
|
+
|
|
|
|
|
+#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
|
|
|
|
|
+ Ticker lixie_animation;
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
uint16_t led_to_x_pos(uint16_t led){
|
|
uint16_t led_to_x_pos(uint16_t led){
|
|
|
uint8_t led_digit_pos = x_offsets[led%22];
|
|
uint8_t led_digit_pos = x_offsets[led%22];
|
|
@@ -73,7 +78,7 @@ void animate(){
|
|
|
uint8_t mask_input_0 = led_mask_0[i];
|
|
uint8_t mask_input_0 = led_mask_0[i];
|
|
|
uint8_t mask_input_1 = led_mask_1[i];
|
|
uint8_t mask_input_1 = led_mask_1[i];
|
|
|
|
|
|
|
|
- if(transition_type == INSTANT || transition_type == CROSSFADE){
|
|
|
|
|
|
|
+ if(trans_type == INSTANT || trans_type == CROSSFADE){
|
|
|
if(current_mask == 0){
|
|
if(current_mask == 0){
|
|
|
mask_float = ((mask_input_0*(1-mask_fader)) + (mask_input_1*(mask_fader)))/255.0;
|
|
mask_float = ((mask_input_0*(1-mask_fader)) + (mask_input_1*(mask_fader)))/255.0;
|
|
|
}
|
|
}
|
|
@@ -82,9 +87,9 @@ void animate(){
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- new_col.r = (color_on[i].r*mask_float) + (color_off[i].r*(1-mask_float));
|
|
|
|
|
- new_col.g = (color_on[i].g*mask_float) + (color_off[i].g*(1-mask_float));
|
|
|
|
|
- new_col.b = (color_on[i].b*mask_float) + (color_off[i].b*(1-mask_float));
|
|
|
|
|
|
|
+ new_col.r = (col_on[i].r*mask_float) + (col_off[i].r*(1-mask_float));
|
|
|
|
|
+ new_col.g = (col_on[i].g*mask_float) + (col_off[i].g*(1-mask_float));
|
|
|
|
|
+ new_col.b = (col_on[i].b*mask_float) + (col_off[i].b*(1-mask_float));
|
|
|
|
|
|
|
|
lix_leds[i] = new_col;
|
|
lix_leds[i] = new_col;
|
|
|
|
|
|
|
@@ -96,12 +101,55 @@ void animate(){
|
|
|
lix_controller->showLeds();
|
|
lix_controller->showLeds();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+void Lixie_II::transition_type(uint8_t type){
|
|
|
|
|
+ trans_type = type;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::transition_time(uint16_t ms){
|
|
|
|
|
+ trans_time = ms;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::run(){
|
|
|
|
|
+ animate();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::wait(){
|
|
|
|
|
+ while(mask_fader < 1.0){
|
|
|
|
|
+ animate();
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
void Lixie_II::start_animation(){
|
|
void Lixie_II::start_animation(){
|
|
|
|
|
+#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
|
|
|
lixie_animation.attach_ms(20, animate);
|
|
lixie_animation.attach_ms(20, animate);
|
|
|
|
|
+#elif defined(__AVR__)
|
|
|
|
|
+ // TIMER 1 for interrupt frequency 50 Hz:
|
|
|
|
|
+ cli(); // stop interrupts
|
|
|
|
|
+ TCCR1A = 0; // set entire TCCR1A register to 0
|
|
|
|
|
+ TCCR1B = 0; // same for TCCR1B
|
|
|
|
|
+ TCNT1 = 0; // initialize counter value to 0
|
|
|
|
|
+ // set compare match register for 50 Hz increments
|
|
|
|
|
+ OCR1A = 39999; // = 16000000 / (8 * 50) - 1 (must be <65536)
|
|
|
|
|
+ // turn on CTC mode
|
|
|
|
|
+ TCCR1B |= (1 << WGM12);
|
|
|
|
|
+ // Set CS12, CS11 and CS10 bits for 8 prescaler
|
|
|
|
|
+ TCCR1B |= (0 << CS12) | (1 << CS11) | (0 << CS10);
|
|
|
|
|
+ // enable timer compare interrupt
|
|
|
|
|
+ TIMSK1 |= (1 << OCIE1A);
|
|
|
|
|
+ sei(); // allow interrupts
|
|
|
|
|
+#endif
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+#if defined(__AVR__)
|
|
|
|
|
+ISR(TIMER1_COMPA_vect){
|
|
|
|
|
+ animate();
|
|
|
}
|
|
}
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
void Lixie_II::stop_animation(){
|
|
void Lixie_II::stop_animation(){
|
|
|
|
|
+#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
|
|
|
lixie_animation.detach();
|
|
lixie_animation.detach();
|
|
|
|
|
+#endif
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Lixie_II::Lixie_II(const uint8_t pin, uint8_t number_of_digits){
|
|
Lixie_II::Lixie_II(const uint8_t pin, uint8_t number_of_digits){
|
|
@@ -113,15 +161,15 @@ Lixie_II::Lixie_II(const uint8_t pin, uint8_t number_of_digits){
|
|
|
led_mask_0 = new uint8_t[n_LEDs];
|
|
led_mask_0 = new uint8_t[n_LEDs];
|
|
|
led_mask_1 = new uint8_t[n_LEDs];
|
|
led_mask_1 = new uint8_t[n_LEDs];
|
|
|
|
|
|
|
|
- color_on = new CRGB[n_LEDs];
|
|
|
|
|
- color_off = new CRGB[n_LEDs];
|
|
|
|
|
|
|
+ col_on = new CRGB[n_LEDs];
|
|
|
|
|
+ col_off = new CRGB[n_LEDs];
|
|
|
|
|
|
|
|
for(uint16_t i = 0; i < n_LEDs; i++){
|
|
for(uint16_t i = 0; i < n_LEDs; i++){
|
|
|
led_mask_0[i] = 0;
|
|
led_mask_0[i] = 0;
|
|
|
led_mask_1[i] = 0;
|
|
led_mask_1[i] = 0;
|
|
|
|
|
|
|
|
- color_on[i] = CRGB(255,255,255);
|
|
|
|
|
- color_off[i] = CRGB(0,0,0);
|
|
|
|
|
|
|
+ col_on[i] = CRGB(255,255,255);
|
|
|
|
|
+ col_off[i] = CRGB(0,0,0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
build_controller(pin);
|
|
build_controller(pin);
|
|
@@ -194,6 +242,26 @@ void Lixie_II::write(uint32_t input){
|
|
|
mask_update();
|
|
mask_update();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+bool char_is_number(char input){
|
|
|
|
|
+ if(input <= 57 && input >= 48) // if between ASCII '9' and '0'
|
|
|
|
|
+ return true;
|
|
|
|
|
+ else
|
|
|
|
|
+ return false;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::write(char* input){
|
|
|
|
|
+ char temp[20] = "";
|
|
|
|
|
+ byte index = 0;
|
|
|
|
|
+ for(uint8_t i = 0; i < 20; i++){
|
|
|
|
|
+ if(char_is_number(input[i])){
|
|
|
|
|
+ temp[index] = input[i];
|
|
|
|
|
+ index++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ uint32_t output = atol(temp);
|
|
|
|
|
+ write(output);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
void Lixie_II::write_float(float input_raw, uint8_t dec_places){
|
|
void Lixie_II::write_float(float input_raw, uint8_t dec_places){
|
|
|
uint16_t dec_places_10s = 1;
|
|
uint16_t dec_places_10s = 1;
|
|
|
float input_mult = input_raw;
|
|
float input_mult = input_raw;
|
|
@@ -316,23 +384,26 @@ void Lixie_II::clear_digit(uint8_t digit, uint8_t num){
|
|
|
void Lixie_II::mask_update(){
|
|
void Lixie_II::mask_update(){
|
|
|
mask_fader = 0.0;
|
|
mask_fader = 0.0;
|
|
|
|
|
|
|
|
- if(transition_type == INSTANT){
|
|
|
|
|
|
|
+ if(trans_type == INSTANT){
|
|
|
mask_push = 1.0;
|
|
mask_push = 1.0;
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
- mask_push = 0.1;
|
|
|
|
|
|
|
+ float trans_multiplier = trans_time / float(1000);
|
|
|
|
|
+ mask_push = 1 / (50.0 * trans_multiplier);
|
|
|
}
|
|
}
|
|
|
mask_fade_finished = false;
|
|
mask_fade_finished = false;
|
|
|
transition_mid_point = false;
|
|
transition_mid_point = false;
|
|
|
|
|
+
|
|
|
|
|
+ // WAIT GOES HERE
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void Lixie_II::color_all(uint8_t layer, CRGB col){
|
|
void Lixie_II::color_all(uint8_t layer, CRGB col){
|
|
|
for(uint16_t i = 0; i < n_LEDs; i++){
|
|
for(uint16_t i = 0; i < n_LEDs; i++){
|
|
|
if(layer == ON){
|
|
if(layer == ON){
|
|
|
- color_on[i] = col;
|
|
|
|
|
|
|
+ col_on[i] = col;
|
|
|
}
|
|
}
|
|
|
else if(layer == OFF){
|
|
else if(layer == OFF){
|
|
|
- color_off[i] = col;
|
|
|
|
|
|
|
+ col_off[i] = col;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -346,18 +417,18 @@ void Lixie_II::color_all_dual(uint8_t layer, CRGB col_left, CRGB col_right){
|
|
|
|
|
|
|
|
if(layer == ON){
|
|
if(layer == ON){
|
|
|
if(side){
|
|
if(side){
|
|
|
- color_on[i] = col_left;
|
|
|
|
|
|
|
+ col_on[i] = col_left;
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
- color_on[i] = col_right;
|
|
|
|
|
|
|
+ col_on[i] = col_right;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else if(layer == OFF){
|
|
else if(layer == OFF){
|
|
|
if(side){
|
|
if(side){
|
|
|
- color_off[i] = col_left;
|
|
|
|
|
|
|
+ col_off[i] = col_left;
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
- color_off[i] = col_right;
|
|
|
|
|
|
|
+ col_off[i] = col_right;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -367,10 +438,10 @@ void Lixie_II::color_display(uint8_t display, uint8_t layer, CRGB col){
|
|
|
uint16_t start_index = leds_per_digit*display;
|
|
uint16_t start_index = leds_per_digit*display;
|
|
|
for(uint16_t i = 0; i < leds_per_digit; i++){
|
|
for(uint16_t i = 0; i < leds_per_digit; i++){
|
|
|
if(layer == ON){
|
|
if(layer == ON){
|
|
|
- color_on[start_index+i] = col;
|
|
|
|
|
|
|
+ col_on[start_index+i] = col;
|
|
|
}
|
|
}
|
|
|
else if(layer == OFF){
|
|
else if(layer == OFF){
|
|
|
- color_off[start_index+i] = col;
|
|
|
|
|
|
|
+ col_off[start_index+i] = col;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -385,30 +456,47 @@ void Lixie_II::gradient_rgb(uint8_t layer, CRGB col_left, CRGB col_right){
|
|
|
col_out.b = (col_right.b*(1-progress)) + (col_left.b*(progress));
|
|
col_out.b = (col_right.b*(1-progress)) + (col_left.b*(progress));
|
|
|
|
|
|
|
|
if(layer == ON){
|
|
if(layer == ON){
|
|
|
- color_on[i] = col_out;
|
|
|
|
|
|
|
+ col_on[i] = col_out;
|
|
|
}
|
|
}
|
|
|
else if(layer == OFF){
|
|
else if(layer == OFF){
|
|
|
- color_off[i] = col_out;
|
|
|
|
|
|
|
+ col_off[i] = col_out;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void Lixie_II::streak(CRGB col, int16_t pos, uint8_t blur){
|
|
|
|
|
|
|
+void Lixie_II::brightness(uint8_t level){
|
|
|
|
|
+ FastLED.setBrightness(level);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::fade_in(){
|
|
|
|
|
+ for(int16_t i = 0; i < 255; i++){
|
|
|
|
|
+ brightness(i);
|
|
|
|
|
+ FastLED.delay(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ brightness(255);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::fade_out(){
|
|
|
|
|
+ for(int16_t i = 255; i > 0; i--){
|
|
|
|
|
+ brightness(i);
|
|
|
|
|
+ FastLED.delay(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ brightness(0);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::streak(CRGB col, float pos, uint8_t blur){
|
|
|
|
|
+ float pos_whole = pos*n_digits*6; // 6 X-positions in a single display
|
|
|
|
|
+
|
|
|
for(uint16_t i = 0; i < n_LEDs; i++){
|
|
for(uint16_t i = 0; i < n_LEDs; i++){
|
|
|
-
|
|
|
|
|
- uint16_t pos_delta = abs(led_to_x_pos(i) - pos);
|
|
|
|
|
|
|
+ uint16_t pos_delta = abs(led_to_x_pos(i) - pos_whole);
|
|
|
if(pos_delta > blur){
|
|
if(pos_delta > blur){
|
|
|
pos_delta = blur;
|
|
pos_delta = blur;
|
|
|
}
|
|
}
|
|
|
float pos_level = 1-(pos_delta/float(blur));
|
|
float pos_level = 1-(pos_delta/float(blur));
|
|
|
|
|
|
|
|
- pos_level*=pos_level;
|
|
|
|
|
|
|
+ pos_level *= pos_level; // Squared for sharper falloff
|
|
|
|
|
|
|
|
- if(i == 0){
|
|
|
|
|
- //Serial.println(pos_level);
|
|
|
|
|
- }
|
|
|
|
|
lix_leds[i] = CRGB(col.r * pos_level, col.g * pos_level, col.b * pos_level);
|
|
lix_leds[i] = CRGB(col.r * pos_level, col.g * pos_level, col.b * pos_level);
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
lix_controller->showLeds();
|
|
lix_controller->showLeds();
|
|
|
}
|
|
}
|
|
@@ -438,7 +526,7 @@ void Lixie_II::sweep_gradient(CRGB col_left, CRGB col_right, uint16_t speed, uin
|
|
|
col_out.g = (col_right.g*(1-progress)) + (col_left.g*(progress));
|
|
col_out.g = (col_right.g*(1-progress)) + (col_left.g*(progress));
|
|
|
col_out.b = (col_right.b*(1-progress)) + (col_left.b*(progress));
|
|
col_out.b = (col_right.b*(1-progress)) + (col_left.b*(progress));
|
|
|
|
|
|
|
|
- streak(col_out, sweep_pos, blur);
|
|
|
|
|
|
|
+ streak(col_out, 1-progress, blur);
|
|
|
FastLED.delay(speed);
|
|
FastLED.delay(speed);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -458,7 +546,7 @@ void Lixie_II::sweep_gradient(CRGB col_left, CRGB col_right, uint16_t speed, uin
|
|
|
col_out.g = (col_right.g*(1-progress)) + (col_left.g*(progress));
|
|
col_out.g = (col_right.g*(1-progress)) + (col_left.g*(progress));
|
|
|
col_out.b = (col_right.b*(1-progress)) + (col_left.b*(progress));
|
|
col_out.b = (col_right.b*(1-progress)) + (col_left.b*(progress));
|
|
|
|
|
|
|
|
- streak(col_out, sweep_pos, blur);
|
|
|
|
|
|
|
+ streak(col_out, progress, blur);
|
|
|
FastLED.delay(speed);
|
|
FastLED.delay(speed);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -466,19 +554,166 @@ void Lixie_II::sweep_gradient(CRGB col_left, CRGB col_right, uint16_t speed, uin
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
uint8_t Lixie_II::get_size(uint32_t input){
|
|
uint8_t Lixie_II::get_size(uint32_t input){
|
|
|
- uint8_t places = 1;
|
|
|
|
|
- while(input > 9){
|
|
|
|
|
- places++;
|
|
|
|
|
- input /= 10;
|
|
|
|
|
- }
|
|
|
|
|
- return places;
|
|
|
|
|
|
|
+ uint8_t places = 1;
|
|
|
|
|
+ while(input > 9){
|
|
|
|
|
+ places++;
|
|
|
|
|
+ input /= 10;
|
|
|
|
|
+ }
|
|
|
|
|
+ return places;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/*
|
|
|
|
|
-void fill_all(CRGB col){
|
|
|
|
|
- for(uint16_t i = 0; i < n_LEDs; i++){
|
|
|
|
|
- led_mask[i] = 255;
|
|
|
|
|
- color_on[i] = col;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+void Lixie_II::nixie(){
|
|
|
|
|
+ color_all(ON, CRGB(255, 70, 7));
|
|
|
|
|
+ color_all(OFF, CRGB(0, 3, 8));
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::white_balance(CRGB c_adj){
|
|
|
|
|
+ lix_controller->setTemperature(c_adj);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::rainbow(uint8_t r_hue, uint8_t r_sep){
|
|
|
|
|
+ for(uint8_t i = 0; i < n_digits; i++){
|
|
|
|
|
+ color_display(i, ON, CHSV(r_hue,255,255));
|
|
|
|
|
+ r_hue+=r_sep;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::clear(bool show_change){
|
|
|
|
|
+ for(uint16_t i = 0; i < n_LEDs; i++){
|
|
|
|
|
+ led_mask_0[i] = 0.0;
|
|
|
|
|
+ led_mask_1[i] = 0.0;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(show_change){
|
|
|
|
|
+ mask_fader = 0.0;
|
|
|
|
|
+ mask_push = 1.0;
|
|
|
|
|
+ mask_fade_finished = false;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::clear_digit(uint8_t index, bool show_change){
|
|
|
|
|
+ uint16_t start_index = index*leds_per_digit;
|
|
|
|
|
+ for(uint16_t i = start_index; i < leds_per_digit; i++){
|
|
|
|
|
+ led_mask_0[i] = 0.0;
|
|
|
|
|
+ led_mask_1[i] = 0.0;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::show(){
|
|
|
|
|
+ mask_update();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// BEGIN LIXIE 1 DEPRECATED FUNCTIONS
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::write_flip(uint32_t input, uint16_t flip_time, uint8_t flip_speed){
|
|
|
|
|
+ // This animation no longer supported, crossfade is used instead
|
|
|
|
|
+ transition_type(CROSSFADE);
|
|
|
|
|
+ transition_time(flip_time);
|
|
|
|
|
+ write(input);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::write_fade(uint32_t input, uint16_t fade_time){
|
|
|
|
|
+ transition_type(CROSSFADE);
|
|
|
|
|
+ transition_time(fade_time);
|
|
|
|
|
+ write(input);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::sweep(CRGB col, uint8_t speed){
|
|
|
|
|
+ sweep_color(col, speed, 3, false);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::progress(float percent, CRGB col1, CRGB col2){
|
|
|
|
|
+ uint16_t crossover_whole = percent * n_digits;
|
|
|
|
|
+ for(uint8_t i = 0; i < n_digits; i++){
|
|
|
|
|
+ if(n_digits-i-1 > crossover_whole){
|
|
|
|
|
+ color_display(n_digits-i-1, ON, col1);
|
|
|
|
|
+ color_display(n_digits-i-1, OFF, col1);
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ color_display(n_digits-i-1, ON, col2);
|
|
|
|
|
+ color_display(n_digits-i-1, OFF, col2);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::fill_fade_in(CRGB col, uint8_t fade_speed){
|
|
|
|
|
+ for(float fade = 0.0; fade < 1.0; fade += 0.05){
|
|
|
|
|
+ for(uint16_t i = 0; i < n_LEDs; i++){
|
|
|
|
|
+ lix_leds[i].r = col.r*fade;
|
|
|
|
|
+ lix_leds[i].g = col.g*fade;
|
|
|
|
|
+ lix_leds[i].b = col.b*fade;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ FastLED.show();
|
|
|
|
|
+ delay(fade_speed);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::fill_fade_out(CRGB col, uint8_t fade_speed){
|
|
|
|
|
+ for(float fade = 1; fade > 0; fade -= 0.05){
|
|
|
|
|
+ for(uint16_t i = 0; i < n_LEDs; i++){
|
|
|
|
|
+ lix_leds[i].r = col.r*fade;
|
|
|
|
|
+ lix_leds[i].g = col.g*fade;
|
|
|
|
|
+ lix_leds[i].b = col.b*fade;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ FastLED.show();
|
|
|
|
|
+ delay(fade_speed);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::color(uint8_t r, uint8_t g, uint8_t b){
|
|
|
|
|
+ color_all(ON,CRGB(r,g,b));
|
|
|
|
|
+}
|
|
|
|
|
+void Lixie_II::color(CRGB c){
|
|
|
|
|
+ color_all(ON,c);
|
|
|
|
|
+}
|
|
|
|
|
+void Lixie_II::color(uint8_t r, uint8_t g, uint8_t b, uint8_t index){
|
|
|
|
|
+ color_display(index, ON, CRGB(r,g,b));
|
|
|
|
|
+}
|
|
|
|
|
+void Lixie_II::color(CRGB c, uint8_t index){
|
|
|
|
|
+ color_display(index, ON, c);
|
|
|
|
|
+}
|
|
|
|
|
+void Lixie_II::color_off(uint8_t r, uint8_t g, uint8_t b){
|
|
|
|
|
+ color_all(OFF,CRGB(r,g,b));
|
|
|
|
|
+}
|
|
|
|
|
+void Lixie_II::color_off(CRGB c){
|
|
|
|
|
+ color_all(OFF,c);
|
|
|
|
|
+}
|
|
|
|
|
+void Lixie_II::color_off(uint8_t r, uint8_t g, uint8_t b, uint8_t index){
|
|
|
|
|
+ color_display(index, OFF, CRGB(r,g,b));
|
|
|
|
|
+}
|
|
|
|
|
+void Lixie_II::color_off(CRGB c, uint8_t index){
|
|
|
|
|
+ color_display(index, OFF, c);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+void Lixie_II::color_fade(CRGB col, uint16_t duration){
|
|
|
|
|
+ // not supported
|
|
|
|
|
+ color_all(ON,col);
|
|
|
|
|
+}
|
|
|
|
|
+void Lixie_II::color_fade(CRGB col, uint16_t duration, uint8_t index){
|
|
|
|
|
+ // not supported
|
|
|
|
|
+ color_display(index,ON,col);
|
|
|
|
|
+}
|
|
|
|
|
+void Lixie_II::color_array_fade(CRGB *cols, uint16_t duration){
|
|
|
|
|
+ // support removed
|
|
|
|
|
+}
|
|
|
|
|
+void Lixie_II::color_array_fade(CHSV *cols, uint16_t duration){
|
|
|
|
|
+ // support removed
|
|
|
|
|
+}
|
|
|
|
|
+void Lixie_II::color_wipe(CRGB col1, CRGB col2){
|
|
|
|
|
+ gradient_rgb(ON,col1,col2);
|
|
|
|
|
+}
|
|
|
|
|
+void Lixie_II::nixie_mode(bool enabled, bool has_aura){
|
|
|
|
|
+ // enabled removed
|
|
|
|
|
+ // has_aura removed
|
|
|
|
|
+ nixie();
|
|
|
}
|
|
}
|
|
|
-*/
|
|
|
|
|
|
|
+void Lixie_II::nixie_aura_intensity(uint8_t val){
|
|
|
|
|
+ // support removed
|
|
|
|
|
+}
|