Merge pull request #42 from PatrickSp/master

added output to control external power supply
This commit is contained in:
bpohvoodoo
2019-10-09 17:03:34 +02:00
committed by GitHub
4 changed files with 18 additions and 1 deletions
+13
View File
@@ -427,6 +427,10 @@ void setup() {
} }
#endif #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 // start ticker with 0.5 because we start in AP mode and try to connect
ticker.attach(0.5, tick); ticker.attach(0.5, tick);
@@ -776,8 +780,17 @@ void loop() {
#if defined(ENABLE_MQTT) #if defined(ENABLE_MQTT)
if (prevmode != mode) { snprintf(mqtt_buf, sizeof(mqtt_buf), "OK =off", ""); } if (prevmode != mode) { snprintf(mqtt_buf, sizeof(mqtt_buf), "OK =off", ""); }
#endif #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 (mode == AUTO) {
if (prevmode != mode) { if (prevmode != mode) {
handleAutoStart(); handleAutoStart();
+1
View File
@@ -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 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_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 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. 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
View File
@@ -1 +1 @@
#define SKETCH_VERSION "2.2.6.RU1.rgbw.3c" #define SKETCH_VERSION "2.2.7.RU1.rgbw.3c"
+3
View File
@@ -165,4 +165,7 @@
* adressed issue: #31 * adressed issue: #31
* adressed issue: #32 * adressed issue: #32
* *
* 09 Oktober 2019
* Version Bump to 2.2.7 rgbw 3colors
* added output to control external power supply
*/ */