Ich hab da nix geschoben...
Hab nur
Code: Alles auswählen
https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json
Ist auch auf der Seite beschrieben:
Ja. Pin 1 (MISO) ist der eckige
Moderator: Co-Administratoren
Ich hab da nix geschoben...
Code: Alles auswählen
https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json
Ja. Pin 1 (MISO) ist der eckige
Code: Alles auswählen
string temp = dom.GetObject('BidCos-RF.OEQ0072229:1.TEMPERATURE').Value().ToString(1) # " °C";
string dc = dom.GetObject('DutyCycle').Value().ToString(0) # " %";
string hdruck = dom.GetObject('BidCos-RF.JPPRESS001:1.UNI_PRESSURE').Value().ToString(2) # " bar";
string displayCmdA = "JPDISEP000 /1 '@p00Außen@p65" # temp # "' /2 '@p00DutyCycle@p65" # dc # "' /3 '@p00Heizungsdruck@p65" # hdruck # "'";
dom.GetObject("CUxD.CUX2801001:1.CMD_EXEC").State("tclsh /usr/local/addons/epaper42.tcl " # displayCmdA);
Code: Alles auswählen
string temp = dom.GetObject('BidCos-RF.OEQ0072229:1.TEMPERATURE').Value().ToString(1) # " °C";
string dc = dom.GetObject('DutyCycle').Value().ToString(0) # " %";
string hdruck = dom.GetObject('BidCos-RF.JPPRESS001:1.UNI_PRESSURE').Value().ToString(2) # " bar";
string line1 = "/1 '@p00Außen@p65" # temp # "'";
string line2 = "/2 '@p00DutyCycle@p65" # dc # "'";
string line3 = "/3 '@p00Heizungsdruck@p65" # hdruck # "'";
Code: Alles auswählen
! Um DutyRate zu sparen nur die Zeilen übertragen die sich geändert haben
string lastLines = dom.GetObject("EPAPER.Lines").Value();
string index;
string linesDoNotUpdate = "";
foreach (index, lastLines) {
if (index.Substr(0, 2) == "/2") {
if (index == line2) {
linesDoNotUpdate = linesDoNotUpdate # "L02";
}
} elseif (index.Substr(0, 2) == "/3") {
if (index == line3) {
linesDoNotUpdate = linesDoNotUpdate # "L03";
}
} elseif (index.Substr(0, 2) == "/4") {
if (index == line4) {
linesDoNotUpdate = linesDoNotUpdate # "L04";
}
} elseif (index.Substr(0, 2) == "/5") {
if (index == line5) {
linesDoNotUpdate = linesDoNotUpdate # "L05";
}
} elseif (index.Substr(0, 2) == "/6") {
if (index == line6) {
linesDoNotUpdate = linesDoNotUpdate # "L06";
}
..... usw.
Code: Alles auswählen
string temp = dom.GetObject('BidCos-RF.OEQ0072229:1.TEMPERATURE').Value().ToString(1) # " °C";
string dc = dom.GetObject('DutyCycle').Value().ToString(0) # " %";
string hdruck = dom.GetObject('BidCos-RF.JPPRESS001:1.UNI_PRESSURE').Value().ToString(2) # " bar";
string line1 = "/1 '@p00Außen@p65" # temp # "'";
string line2 = "/2 '@p00DutyCycle@p65" # dc # "'";
string line3 = "/3 '@p00Heizungsdruck@p65" # hdruck # "'";
! Um DutyRate zu sparen nur die Zeilen übertragen die sich geändert haben
string lastLines = dom.GetObject("EPAPER.Lines").Value();
string index;
string linesDoNotUpdate = "";
foreach (index, lastLines) {
if (index.Substr(0, 2) == "/1") {
if (index == line1) {
linesDoNotUpdate = linesDoNotUpdate # "L01";
}
} elseif (index.Substr(0, 2) == "/2") {
if (index == line2) {
linesDoNotUpdate = linesDoNotUpdate # "L02";
}
} elseif (index.Substr(0, 2) == "/3") {
if (index == line3) {
linesDoNotUpdate = linesDoNotUpdate # "L03";
}
}
}
! Wegen einem Limit bei der RF Übertragung in der CCU kann man nicht alle 10 in einem Funktelegramm übertragen.
! Deswegen wird hier die Übertragung immer in 2 Funktelegramme aufgeteilt.
string displayCmdA = "JPDISEP000";
integer iChangedLinesA = 0;
if (linesDoNotUpdate.Find("L01") < 0) {
displayCmdA = displayCmdA # " " # line1; iChangedLinesA = iChangedLinesA + 1;
}
if (linesDoNotUpdate.Find("L02") < 0) {
displayCmdA = displayCmdA # " " # line2; iChangedLinesA = iChangedLinesA + 1;
}
if (linesDoNotUpdate.Find("L03") < 0) {
displayCmdA = displayCmdA # " " # line3; iChangedLinesA = iChangedLinesA + 1;
}
if (iChangedLinesA > 0) {
dom.GetObject("CUxD.CUX2801001:1.CMD_EXEC").State("tclsh /usr/local/addons/epaper42.tcl " # displayCmdA);
}
! Für nächsten Vergleich speichern, Tab Seperator für for_each loop benötigt
string currentLines = line1 # "\t" line2 # "\t" # line3;
dom.GetObject("EPAPER.Lines").State(currentLines);
Code: Alles auswählen
! Temp/Feuchte außen
Code: Alles auswählen
! Um DutyRate zu sparen nur die Zeilen übertragen die sich geändert haben