Zeige aktuelle Konsole auch an, wenn sie via MQTT geschaltet wurde.

This commit is contained in:
starcalc 2018-01-30 22:56:50 +01:00
parent dbd05e4408
commit 206e043bd8
1 changed files with 7 additions and 7 deletions

View File

@ -266,6 +266,12 @@ bool switchHandler(const HomieRange& range, const String& value) {
swSer.write(commandbytes[1]); swSer.write(commandbytes[1]);
swSer.write(commandbytes[2]); swSer.write(commandbytes[2]);
swSer.write(commandbytes[3]); swSer.write(commandbytes[3]);
// Zeige aktuelle Quelle auf dem Strip an
strip.None();
strip.clear();
strip.show();
strip.colorBox(commandbytes[1]-128, strip.Color(255, 255, 255));
strip.show();
} }
else else
{ {
@ -338,6 +344,7 @@ void loop() {
ArduinoOTA.handle(); ArduinoOTA.handle();
while (swSer.available() > 0) { while (swSer.available() > 0) {
ArduinoOTA.handle();
lastMillis = millis(); lastMillis = millis();
int r1 = swSer.read(); int r1 = swSer.read();
Serial.print(currentnumber); Serial.print(currentnumber);
@ -363,15 +370,8 @@ void loop() {
// Zeige aktuelle Quelle auf dem Strip an // Zeige aktuelle Quelle auf dem Strip an
strip.None(); strip.None();
strip.clear(); strip.clear();
// for (int j=0;j<NUMPIXELS;j++)
// {
// strip.setPixelColor(j, strip.Color(0, 0, 0));
// }
strip.show(); strip.show();
strip.colorBox(inputbytes[1]-128, strip.Color(255, 255, 255)); strip.colorBox(inputbytes[1]-128, strip.Color(255, 255, 255));
// strip.setPixelColor((inputbytes[1]-128)*3, strip.Color(255, 0, 0));
// strip.setPixelColor((inputbytes[1]-128)*3+1, strip.Color(255, 0, 0));
// strip.setPixelColor((inputbytes[1]-128)*3+2, strip.Color(255, 0, 0));
strip.show(); strip.show();
currentnumber = 0; currentnumber = 0;