From fd3fb678bf3d82d8fae8e3cc17c0a55e93a12582 Mon Sep 17 00:00:00 2001 From: starcalc Date: Sun, 17 Mar 2019 18:15:02 +0100 Subject: [PATCH] Typumwandlung korrigiert, default Brightness 255, scrollinfo via mqtt --- esp-pixelbox.ino | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/esp-pixelbox.ino b/esp-pixelbox.ino index afd50f8..b3aba9d 100644 --- a/esp-pixelbox.ino +++ b/esp-pixelbox.ino @@ -141,20 +141,22 @@ bool onSetEffect(const HomieRange& range, const String& value) { if (sep2 > 0) { // Interval was given String stext = parameters.substring(0, sep2); - String sinterval = parameters.substring(sep2 + 1).toInt(); + String sinterval = parameters.substring(sep2 + 1); int sep3 = sinterval.indexOf("|"); if (sep3 > 0) { // Color was given int iinterval = sinterval.substring(0, sep3).toInt(); String scolor = sinterval.substring(sep3 + 1); + homieNode.setProperty("scrollinfo").send("Scroll with interval " + sinterval.substring(0, sep3) + " and color " + sinterval.substring(sep3 + 1)); matrix.ScrollText(stext, iinterval, scolor); } else { + homieNode.setProperty("scrollinfo").send("Scroll with interval " + parameters.substring(sep2 + 1)); int iinterval = parameters.substring(sep2 + 1).toInt(); matrix.ScrollText(stext, iinterval); - } } else { + homieNode.setProperty("scrollinfo").send("Just scroll"); matrix.ScrollText(parameters); } } @@ -252,7 +254,7 @@ void loopHandler() { void setup() { Serial.begin(115200); - Homie_setFirmware("pixelbox", "1.1.0"); + Homie_setFirmware("pixelboxtest", "1.1.0"); Homie.setLoopFunction(loopHandler); homieNode.advertiseRange("pixel", 0, NUMPIXELS - 1).settable(onSetPixel); @@ -264,18 +266,19 @@ void setup() { homieNode.advertise("icon").settable(onSetIcon); homieNode.advertiseRange("pixels", 0, (NUMPIXELS - 1) * 7).settable(onSetPixels); - Homie.setup(); strip.begin(); strip.clear(); // strip.setBrightness(64); - // strip.setBrightness(255); // HEEELLLLLLL :) - strip.setBrightness(10); // DEBUG! + strip.setBrightness(255); // HEEELLLLLLL :) + // strip.setBrightness(10); // DEBUG! strip.show(); stopAfterCompletion = false; // Default strip.Plasma(); // Default effect - ArduinoOTA.setHostname("pixelbox"); + Homie.setup(); + + ArduinoOTA.setHostname("pixelboxtest"); ArduinoOTA.onStart([]() { strip.clear(); strip.setBrightness(64); @@ -290,7 +293,7 @@ void setup() { ArduinoOTA.begin(); matrix.begin(); matrix.setTextWrap(false); - matrix.setBrightness(32); + matrix.setBrightness(255); } void loop() {