mirror of
https://github.com/synthetos/g2.git
synced 2026-09-22 19:43:53 +08:00
PrintrboardG2: All LEDs temporarily forced to white when in “normal” states.
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
namespace LEDs {
|
||||
NeoPixel<Motate::kLED_RGBWPixelPinNumber, 3> rgbw_leds {NeoPixelOrder::GRBW};
|
||||
|
||||
RGB_Color_t display_color[3] {{0, 0, 0, 5}, {0, 0, 0, 5}, {0, 0, 0, 5}};
|
||||
RGB_Color_t display_color[3] {{1, 1, 1, 5}, {1, 1, 1, 5}, {1, 1, 1, 5}};
|
||||
|
||||
bool alarm_red = false; // if we are in alarm, the tells us if we're going to red (pulsing)
|
||||
bool shutdown_white = false; // if we are in shutdown, the tells us if we're going to red (pulsing)
|
||||
@@ -121,12 +121,12 @@ stat_t hardware_periodic()
|
||||
LEDs::alarm_red = !LEDs::alarm_red;
|
||||
}
|
||||
|
||||
// Transistion to HOMING state, fade to white
|
||||
} else if ((LEDs::last_see_machine_state != MACHINE_CYCLE) && (new_machine_state == MACHINE_CYCLE)) {
|
||||
// set to white
|
||||
for (uint8_t pixel = 0; pixel < LEDs::rgbw_leds.count; pixel++) {
|
||||
LEDs::display_color[pixel].startTransition(5000, 1, 1, 1);
|
||||
}
|
||||
// // Transistion to HOMING state, fade to white
|
||||
// } else if ((LEDs::last_see_machine_state != MACHINE_CYCLE) && (new_machine_state == MACHINE_CYCLE)) {
|
||||
// // set to white
|
||||
// for (uint8_t pixel = 0; pixel < LEDs::rgbw_leds.count; pixel++) {
|
||||
// LEDs::display_color[pixel].startTransition(5000, 1, 1, 1);
|
||||
// }
|
||||
// catch transition from alarm to reset to black
|
||||
} else if ((LEDs::last_see_machine_state == MACHINE_ALARM) && (new_machine_state != MACHINE_ALARM)) {
|
||||
// set to black
|
||||
@@ -135,10 +135,15 @@ stat_t hardware_periodic()
|
||||
}
|
||||
LEDs::alarm_red = false;
|
||||
|
||||
} else if ((LEDs::last_see_machine_state == MACHINE_READY) && (new_machine_state != MACHINE_READY)) {
|
||||
// set to black
|
||||
// } else if ((LEDs::last_see_machine_state == MACHINE_READY) && (new_machine_state != MACHINE_READY)) {
|
||||
// // set to black
|
||||
// for (uint8_t pixel = 0; pixel < LEDs::rgbw_leds.count; pixel++) {
|
||||
// LEDs::display_color[pixel].startTransition(0, 0, 0, 0);
|
||||
// }
|
||||
} else if ((LEDs::last_see_machine_state == MACHINE_READY)) {
|
||||
// set to white
|
||||
for (uint8_t pixel = 0; pixel < LEDs::rgbw_leds.count; pixel++) {
|
||||
LEDs::display_color[pixel].startTransition(0, 0, 0, 0);
|
||||
LEDs::display_color[pixel].startTransition(0, 1, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user