From 02583b9497541ae6edf82c7e12d3fda1e905d571 Mon Sep 17 00:00:00 2001 From: Marcus Date: Mon, 7 Aug 2023 00:44:15 +0200 Subject: [PATCH] progress --- main/main.ino | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/main/main.ino b/main/main.ino index e0b8463..7a889be 100644 --- a/main/main.ino +++ b/main/main.ino @@ -52,13 +52,13 @@ int cTemp = 5; void setup() { // put your setup code here, to run once: pinMode(MOSFET1, OUTPUT); + pinMode(MOSFET2, OUTPUT); + Serial.begin(9600); sensors.begin(); - - - // locate devices on the bus + // locate devices on the bus Serial.println("Locating devices..."); Serial.print("Found "); deviceCount = sensors.getDeviceCount(); @@ -77,6 +77,16 @@ void setup() { } Serial.println(""); + Serial.print("MOSFET1 start temp: "); + Serial.print(HTemp1); + Serial.print("°C, stop temp: "); + Serial.print(LTemp1); + Serial.println("°C"); + Serial.print("MOSFET2 start temp: "); + Serial.print(HTemp2); + Serial.print("°C, stop temp: "); + Serial.print(LTemp2); + Serial.println("°C"); } void loop() { @@ -106,7 +116,7 @@ void loop() { } - + /* Serial.print("Sens 1 "); Serial.print("Celsius temperature: "); // Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire @@ -124,7 +134,18 @@ void loop() { Serial.print(sensors.getTempF(addrSensor2)); Serial.print(" - MOSFET2 Sate: "); Serial.println(fetState2); - + */ + + StaticJsonDocument<96> jsonOut; + //jsonOut["sensor"] = "1"; + jsonOut["sensor1"]["temp"] = tempSensor1; + jsonOut["sensor1"]["state"] = fetState1; + + //jsonOut["sensor"] = "2"; + jsonOut["sensor2"]["temp"] = tempSensor2; + jsonOut["sensor2"]["state"] = fetState2; + serializeJson(jsonOut, Serial); + Serial.println(); /* digitalWrite(MOSFET, HIGH); delay(2000);