This commit is contained in:
parent
b590561c0d
commit
b4c9480713
|
@ -9,7 +9,7 @@
|
||||||
#define CHARGE_PIN 5
|
#define CHARGE_PIN 5
|
||||||
#define MEASURING_PIN 36
|
#define MEASURING_PIN 36
|
||||||
#define RESISTOR_VALUE 1e6
|
#define RESISTOR_VALUE 1e6
|
||||||
#define MQTT_SERVER "test.mosquitto.org"
|
#define MQTT_SERVER "mqtt.ammar.engineer"
|
||||||
#define MQTT_PORT 1883
|
#define MQTT_PORT 1883
|
||||||
#define MQTT_TOPIC_CAPCITANCE "pipe_system/capacitance"
|
#define MQTT_TOPIC_CAPCITANCE "pipe_system/capacitance"
|
||||||
#define DEVICE_ID "PIPE_01"
|
#define DEVICE_ID "PIPE_01"
|
||||||
|
@ -80,7 +80,6 @@ float capacitance(int discharge_pin, int charge_pin, int measuring_pin) {
|
||||||
elapsed_time = millis() - start_time;
|
elapsed_time = millis() - start_time;
|
||||||
nanoFarads = ((float)elapsed_time / RESISTOR_VALUE) * 1e6;
|
nanoFarads = ((float)elapsed_time / RESISTOR_VALUE) * 1e6;
|
||||||
Serial.println((long) nanoFarads);
|
Serial.println((long) nanoFarads);
|
||||||
delay(1000);
|
|
||||||
|
|
||||||
return nanoFarads;
|
return nanoFarads;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue