[ONOFF] - Improve Led display (#1430)
Improve Led display when limits are reached
This commit is contained in:
1 parent
23160ad8b4
commit
e53c48dd96
3 files changed
+28
-18
No files matched your search
+17
-1
@@ -452,9 +452,13 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE;
|
||||
# define SendReceiveIndicatorOFF() digitalWrite(LED_SEND_RECEIVE, !LED_SEND_RECEIVE_ON)
|
||||
# define InfoIndicatorON() digitalWrite(LED_INFO, LED_INFO_ON)
|
||||
# define InfoIndicatorOFF() digitalWrite(LED_INFO, !LED_INFO_ON)
|
||||
# define CriticalIndicatorON() // Not used
|
||||
#else // Management of Errors, reception/emission and informations indicators with RGB LED
|
||||
# include <FastLED.h>
|
||||
CRGB leds[FASTLED_IND_NUM_LEDS];
|
||||
# ifdef FASTLED_IND_DATA_GPIO2 // Only used for Critical Indicator
|
||||
CRGB leds2[FASTLED_IND_NUM_LEDS];
|
||||
# endif
|
||||
# ifndef RGB_LED_POWER
|
||||
# define RGB_LED_POWER -1 // If the RGB Led is linked to GPIO pin for power define it here
|
||||
# endif
|
||||
@@ -471,12 +475,15 @@ CRGB leds[FASTLED_IND_NUM_LEDS];
|
||||
# ifndef FASTLED_ERROR_LED
|
||||
# define FASTLED_ERROR_LED 0 // First Led
|
||||
# endif
|
||||
# ifndef FASTLED_CRITICAL_LED
|
||||
# define FASTLED_CRITICAL_LED 0 // First Led
|
||||
# endif
|
||||
|
||||
# define SetupIndicators() \
|
||||
pinMode(RGB_LED_POWER, OUTPUT); \
|
||||
digitalWrite(RGB_LED_POWER, HIGH); \
|
||||
FastLED.addLeds<FASTLED_IND_TYPE, FASTLED_IND_DATA_GPIO>(leds, FASTLED_IND_NUM_LEDS); \
|
||||
FastLED.setBrightness(FASTLED_BRIGHTNESS);
|
||||
FastLED.setBrightness(FASTLED_BRIGHTNESS)
|
||||
# define ErrorIndicatorON() \
|
||||
leds[FASTLED_ERROR_LED] = CRGB::Orange; \
|
||||
FastLED.show()
|
||||
@@ -495,6 +502,15 @@ CRGB leds[FASTLED_IND_NUM_LEDS];
|
||||
# define InfoIndicatorOFF() \
|
||||
leds[FASTLED_INFO_LED] = CRGB::Black; \
|
||||
FastLED.show()
|
||||
# ifdef FASTLED_IND_DATA_GPIO2
|
||||
// For the critical ON indicator there is no method to turn it off, the only way is to unplug the device
|
||||
// This enable to have persistence of the indicator to inform the user
|
||||
# define CriticalIndicatorON() \
|
||||
FastLED.addLeds<FASTLED_IND_TYPE, FASTLED_IND_DATA_GPIO2>(leds2, FASTLED_IND_NUM_LEDS); \
|
||||
FastLED.setBrightness(FASTLED_BRIGHTNESS); \
|
||||
leds2[FASTLED_INFO_LED] = CRGB::Red; \
|
||||
FastLED.show()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef ESP8266
|
||||
|
||||
Reference in new issue
Block a user