#ifndef MOISTURE_H #define MOISTURE_H #include #include #include "config.h" static const int8_t sensorPins[] = { #ifdef MOISTURE_SENSOR_A0 MOISTURE_SENSOR_A0, #endif #ifdef MOISTURE_SENSOR_A1 MOISTURE_SENSOR_A1, #endif #ifdef MOISTURE_SENSOR_A2 MOISTURE_SENSOR_A2, #endif #ifdef MOISTURE_SENSOR_A3 MOISTURE_SENSOR_A3, #endif #ifdef MOISTURE_SENSOR_A4 MOISTURE_SENSOR_A4, #endif #ifdef MOISTURE_SENSOR_A5 MOISTURE_SENSOR_A5, #endif #ifdef MOISTURE_SENSOR_A6 MOISTURE_SENSOR_A6, #endif #ifdef MOISTURE_SENSOR_A7 MOISTURE_SENSOR_A7, #endif }; #define SENSORS_NUM (sizeof(sensorPins) / sizeof(sensorPins[0])) extern volatile bool readSensors; void sensorsInit(void); void triggerMoistureRead(void); uint16_t moistureAverage(uint8_t sensorPin); uint16_t moistureRead(void); #endif