added output to control external power supply
If defined, enable output to control external power supply PIN (12 / D6)
This commit is contained in:
@@ -427,6 +427,10 @@ void setup() {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(POWER_SUPPLY)
|
||||
pinMode(POWER_SUPPLY, OUTPUT); // output to control external power supply
|
||||
#endif
|
||||
|
||||
// start ticker with 0.5 because we start in AP mode and try to connect
|
||||
ticker.attach(0.5, tick);
|
||||
|
||||
@@ -776,8 +780,17 @@ void loop() {
|
||||
#if defined(ENABLE_MQTT)
|
||||
if (prevmode != mode) { snprintf(mqtt_buf, sizeof(mqtt_buf), "OK =off", ""); }
|
||||
#endif
|
||||
#if defined(POWER_SUPPLY)
|
||||
if (prevmode != mode) {digitalWrite(POWER_SUPPLY, LOW); } // power off -> external power supply
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(POWER_SUPPLY)
|
||||
if (mode != OFF) {
|
||||
if (prevmode != mode) {digitalWrite(POWER_SUPPLY, HIGH); } // power on -> external power supply
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mode == AUTO) {
|
||||
if (prevmode != mode) {
|
||||
handleAutoStart();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#define FX_OPTIONS 48 // ws2812fx Options 48 = SIZE_SMALL + FADE_MEDIUM is configurable just for the start; for WS2812FX setSegment OPTIONS, see: https://github.com/kitesurfer1404/WS2812FX/blob/master/extras/WS2812FX%20Users%20Guide.md
|
||||
//#define LED_TYPE_WS2811 // Uncomment, if LED type uses 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
|
||||
#define LED_BUILTIN 2 // ESP-12F has the built in LED on GPIO2, see https://github.com/esp8266/Arduino/issues/2192
|
||||
#define POWER_SUPPLY 12 // PIN (12 / D6) If defined, enable output to control external power supply
|
||||
|
||||
char HOSTNAME[65] = "McLightingRGBW"; // Friedly hostname is configurable just for the start. Hostname should not contain spaces as this can break Home Assistant discovery if used.
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define SKETCH_VERSION "2.2.6.RU1.rgbw.3c"
|
||||
#define SKETCH_VERSION "2.2.7.RU1.rgbw.3c"
|
||||
|
||||
@@ -165,4 +165,7 @@
|
||||
* adressed issue: #31
|
||||
* adressed issue: #32
|
||||
*
|
||||
* 09 Oktober 2019
|
||||
* Version Bump to 2.2.7 rgbw 3colors
|
||||
* added output to control external power supply
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user