/* Radical EcoSystem — Moisture Threshold Patch Author: Carlotta Premazzi Program: Fabricademy 2025/2026 System Type: Bio-Hybrid Installation Description: This patch reads soil moisture values from an analog sensor and classifies them into three environmental states: DRY, OK, and WET. Two thresholds define the system: - dryThreshold → above this value, the system is considered DRY - wetThreshold → below this value, the system is considered WET - values in between define the OK state The current state and raw sensor value are printed to the Serial Monitor, allowing calibration and real-time observation of environmental conditions. This simple logic forms the base layer for behaviour in the installation. */ const int moisturePin = A1; int moistureValue = 0; // Thresholds (to be calibrated) int dryThreshold = 600; int wetThreshold = 300; void setup() { Serial.begin(57600); } void loop() { moistureValue = analogRead(moisturePin); if (moistureValue > dryThreshold) { Serial.print("State: DRY | Value: "); Serial.println(moistureValue); } else if (moistureValue < wetThreshold) { Serial.print("State: WET | Value: "); Serial.println(moistureValue); } else { Serial.print("State: OK | Value: "); Serial.println(moistureValue); } delay(500); }