diff --git a/src/config.h b/src/config.h index 97627ff..4d3d7a4 100644 --- a/src/config.h +++ b/src/config.h @@ -3,6 +3,7 @@ #define PIN_DHT 16 #define PIN_ATOMIZER 4 +#define PIN_ATOMIZER_LDR 33 // mqtt://interact:c9FjEDUnRgDTalBR@interact.cloud.shiftr.io #define MQTT_BROKER "interact.cloud.shiftr.io" diff --git a/src/main.cpp b/src/main.cpp index 8865993..cc67a71 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,7 +14,7 @@ #include "mqtt.h" DHT dht(PIN_DHT, DHT11); -Atomizer fog(PIN_ATOMIZER); +Atomizer fog(PIN_ATOMIZER, PIN_ATOMIZER_LDR); typedef struct dhtReading { float humidity, // in % @@ -32,8 +32,6 @@ void setup() { Serial.begin(115200); LOG_INIT(); - pinMode(PIN_ATOMIZER, OUTPUT); - duty.setFrequency(0.05); duty.setAmplitude(0.5); duty.setPhase(0); @@ -51,6 +49,8 @@ void setup() { Serial.println("Brace! Brace! trying to continue without wifi..."); } + fog.calibrate(); + mqtt_init(); Serial.println("Initializing DHT sensor...");