-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (20 loc) · 663 Bytes
/
Copy pathmain.py
File metadata and controls
30 lines (20 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# AquaFusion - BSIT 4A - CPSTONE
import subprocess
import signal
import time
y = 0.1
python3_path = '/usr/bin/python3'
process1 = subprocess.Popen([python3_path, 'ultrasonic_plant_HC-SR04.py'])
time.sleep(y)
process2 = subprocess.Popen([python3_path, 'ultrasonic_waterlevel_HC-SR04.py'])
time.sleep(y)
process3 = subprocess.Popen([python3_path, 'submersibleTemp_DS18B20.py'])
time.sleep(y)
process4 = subprocess.Popen([python3_path, 'sensor_DHT22.py'])
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
print("Ctrl+C detected. Stopping processes...")
process1.send_signal(signal.SIGINT)
process2.send_signal(signal.SIGINT)