Make sensor initialization and measurement more dynamic by checking

which one are declared in config.h
This commit is contained in:
2025-05-17 12:47:59 +02:00
parent ba10840f50
commit 8ad766c377
3 changed files with 52 additions and 37 deletions
+4 -9
View File
@@ -1,28 +1,23 @@
#ifndef CONFIG_H
#define CONFIG_H
//#define VASE_NUM 0
#define MOISTURE_SENSOR_A0 PC0
#define MOISTURE_SENSOR_A1 PC1
#define MOISTURE_SENSOR_A2 PC2
#define MOISTURE_SENSOR_A3 PC3
#define MOISTURE_SENSOR_A4 PC4
#define MOISTURE_SENSOR_A5 PC5
// NOTE: PC6 PC7 are not accessible by default on Arduino Uno R3
// You need to use the ATMega328p on a custom PCB and use pins 1 and 2
//#define MOISTURE_SENSOR_A6 PC6
//#define MOISTURE_SENSOR_A7 PC7
// You may just connect the pumps that actually are needed in the vase
// or define only the connected pumps on your system
#define PUMP_D3 PD3
#define PUMP_D4 PD4
#define PUMP_D5 PD5
#define PUMP_D6 PD6
#define PUMP_D7 PD7
//#define PUMP_D6 PD6
//#define PUMP_D7 PD7
// TODO: write these to eeprom
#define SENSOR_READINGS 5
#define SENSORS_NUM 6
//#define VASE_NUM 0
#endif