diff --git a/main/main.ino b/main/main.ino index b98e7e8..9087861 100644 --- a/main/main.ino +++ b/main/main.ino @@ -28,7 +28,6 @@ const uint16_t PIN_IR_RECIEVER = D4; const uint16_t PIN_IR_SEND = D2; const uint16_t PIN_LDR = A0; const uint16_t PIN_ACTIVE_BUZZER = D5; -const uint16_t PIN_SOIL_MOISTURE = D3; const char* PARAMETER_PLUG_ADDRESS="plug_address"; const char* PARAMETER_PLUG_ID="plug_id"; @@ -196,9 +195,21 @@ String getJsonPir(void){ } String getJsonSoilMoisture(void){ - Serial.println("Reading soil moisture..."); - pinMode(PIN_SOIL_MOISTURE, INPUT); - return "{\"is_moist\":\""+String((digitalRead(PIN_SOIL_MOISTURE)==LOW)?"true":"false")+"\"}"; + Serial.println("Reading soil moisture from PIN ..."); + String moistures = "["; + int array_elements=(sizeof(PINS_SOIL_MOISTURE) / sizeof(uint16_t)); + for (int index=0; index