HomeWaterLeaksDetection
Pins.h
Go to the documentation of this file.
1 #ifndef PINS_H
2 #define PINS_H
3 
4 #include "Setup.h"
5 
6 //==================sensor pin==========================
7 #ifdef UNIT_TEST
8 # define SENSOR_PIN A14
9 # else
10 # define SENSOR_PIN 2
11 #endif
12 
13 //==================main valve==========================
14 #define VALVE_PIN 8
15 #define VALVE_LED_PIN 9
16 
17 //=================reset buttons========================
18 #define VALVE_MANUAL_CLOSE_PIN 23
19 #define RESET_PIN 26
20 
21 //==================home alarm==========================
22 #define HOME_ALARM_PIN 24
23 
24 //================HIGH water leak=======================
25 #define HIGH_BYPASS_PIN 49
26 #define HIGH_ILOCK_LED_PIN 48
27 
28 //=================LOW water leak=======================
29 #define LOW_BYPASS_PIN 47
30 #define LOW_ILOCK_LED_PIN 46
31 
32 //================TOTAL water leak======================
33 #define TOTAL_BYPASS_PIN 45
34 #define TOTAL_ILOCK_LED_PIN 44
35 
36 //==============PINs initialization=====================
37 #define CONFIG_PINS \
38  pinMode(SENSOR_PIN, INPUT); \
39  pinMode(HIGH_BYPASS_PIN, INPUT); \
40  pinMode(LOW_BYPASS_PIN, INPUT); \
41  pinMode(RESET_PIN, INPUT); \
42  pinMode(TOTAL_BYPASS_PIN, INPUT); \
43  pinMode(HOME_ALARM_PIN, INPUT); \
44  pinMode(VALVE_PIN, OUTPUT); \
45  pinMode(VALVE_MANUAL_CLOSE_PIN, INPUT); \
46  pinMode(HIGH_ILOCK_LED_PIN, OUTPUT); \
47  pinMode(LOW_ILOCK_LED_PIN, OUTPUT); \
48  pinMode(TOTAL_ILOCK_LED_PIN, OUTPUT); \
49  pinMode(VALVE_LED_PIN, OUTPUT); \
50  digitalWrite(VALVE_PIN, HIGH); // don't close the main valve when booting up
51  // 0=close; 1=open
52 #endif
Setup.h