diff --git a/.devcontainer/nodered/flows.json b/.devcontainer/nodered/flows.json index 6e67f88..811909c 100644 --- a/.devcontainer/nodered/flows.json +++ b/.devcontainer/nodered/flows.json @@ -1519,7 +1519,7 @@ "type": "debug", "z": "41526b8c80d5a5f7", "name": "debug 1", - "active": true, + "active": false, "tosidebar": true, "console": false, "tostatus": false, @@ -1585,6 +1585,31 @@ ] ] }, + { + "id": "deadd211f38d9561", + "type": "inject", + "z": "41526b8c80d5a5f7", + "name": "", + "props": [ + { + "p": "payload" + } + ], + "repeat": "0.1", + "crontab": "", + "once": true, + "onceDelay": 0.1, + "topic": "", + "payload": "{\"t\":0}", + "payloadType": "json", + "x": 1140, + "y": 140, + "wires": [ + [ + "bf55b8bf4a7aaf10" + ] + ] + }, { "id": "5fe915fcd26e78ae", "type": "ui-group", @@ -1734,7 +1759,7 @@ } }, { - "id": "f77ff628addd5fe5", + "id": "42905d93d09af6d5", "type": "global-config", "env": [], "modules": { diff --git a/AutomForArduino.cpp b/AutomForArduino.cpp index daf0bbf..ba55da8 100644 --- a/AutomForArduino.cpp +++ b/AutomForArduino.cpp @@ -107,7 +107,7 @@ public: if (j.empty()) return; if (j.contains("marche")) marche = j["marche"].get() != 0; - if (j.contains("arret")) arret = j["arret"].get() != 1; + if (j.contains("arret")) arret = j["arret"].get() != 0; if (j.contains("b0")) b0 = j["b0"].get() != 0; if (j.contains("b1")) b1 = j["b1"].get() != 0; @@ -118,14 +118,14 @@ public: if (j.contains("b6")) b6 = j["b6"].get() != 0; if (j.contains("b7")) b7 = j["b7"].get() != 0; - if (j.contains("i0")) b0 = j["i0"].get() != 0; - if (j.contains("i1")) b1 = j["i1"].get() != 0; - if (j.contains("i2")) b2 = j["i2"].get() != 0; - if (j.contains("i3")) b3 = j["i3"].get() != 0; - if (j.contains("i4")) b4 = j["i4"].get() != 0; - if (j.contains("i5")) b5 = j["i5"].get() != 0; - if (j.contains("i6")) b6 = j["i6"].get() != 0; - if (j.contains("i7")) b7 = j["i7"].get() != 0; + if (j.contains("i0")) i0 = j["i0"].get() != 0; + if (j.contains("i1")) i1 = j["i1"].get() != 0; + if (j.contains("i2")) i2 = j["i2"].get() != 0; + if (j.contains("i3")) i3 = j["i3"].get() != 0; + if (j.contains("i4")) i4 = j["i4"].get() != 0; + if (j.contains("i5")) i5 = j["i5"].get() != 0; + if (j.contains("i6")) i6 = j["i6"].get() != 0; + if (j.contains("i7")) i7 = j["i7"].get() != 0; std::cout << "Pompes : " << marche << " " << arret << " " << b0 << " " << b1 << " " << b2 << " " << b3 << " " << b4 << " " << b5 << " " << b6 << " " << b7 << std::endl; } diff --git a/main.cpp b/main.cpp index 6118324..9638c40 100644 --- a/main.cpp +++ b/main.cpp @@ -7,10 +7,10 @@ int main() while (1) { - s0 = b0; - s1 = b1; - s2 = b2; - s3 = b3; + s0 = i0; + s1 = i1; + s2 = i2; + s3 = i3; s4 = b4; s5 = b5; s6 = b6;