progress
This commit is contained in:
parent
ea27ac3c7b
commit
02583b9497
1 changed files with 26 additions and 5 deletions
|
@ -52,12 +52,12 @@ int cTemp = 5;
|
||||||
void setup() {
|
void setup() {
|
||||||
// put your setup code here, to run once:
|
// put your setup code here, to run once:
|
||||||
pinMode(MOSFET1, OUTPUT);
|
pinMode(MOSFET1, OUTPUT);
|
||||||
|
pinMode(MOSFET2, OUTPUT);
|
||||||
|
|
||||||
|
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
sensors.begin();
|
sensors.begin();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// locate devices on the bus
|
// locate devices on the bus
|
||||||
Serial.println("Locating devices...");
|
Serial.println("Locating devices...");
|
||||||
Serial.print("Found ");
|
Serial.print("Found ");
|
||||||
|
@ -77,6 +77,16 @@ void setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Serial.println("");
|
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() {
|
void loop() {
|
||||||
|
@ -106,7 +116,7 @@ void loop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
Serial.print("Sens 1 ");
|
Serial.print("Sens 1 ");
|
||||||
Serial.print("Celsius temperature: ");
|
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
|
// 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(sensors.getTempF(addrSensor2));
|
||||||
Serial.print(" - MOSFET2 Sate: ");
|
Serial.print(" - MOSFET2 Sate: ");
|
||||||
Serial.println(fetState2);
|
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);
|
digitalWrite(MOSFET, HIGH);
|
||||||
delay(2000);
|
delay(2000);
|
||||||
|
|
Loading…
Reference in a new issue