-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinitBZ.py
More file actions
43 lines (32 loc) · 1.33 KB
/
initBZ.py
File metadata and controls
43 lines (32 loc) · 1.33 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
################################################################
# This script should be used before starting the experiments
# to make sure everything is working and tubes are filled
################################################################
import time
from pumpsctl.pumpsctl import PumpsCtl
from bzboard.bzboard import BZBoard
from img_proc.record_cam import RecordVideo
import os, sys
sys.path.append(os.path.abspath('..'))
from tools.volctl import VolCtl
v = VolCtl()
b = BZBoard("/dev/ttyACM1")
p = PumpsCtl('/dev/ttyACM0', v)
rv = RecordVideo(10)
waste = {'pump':'P0', 'quantity':75, 'speedIn':50, 'speedOut':50}
water = {'pump':'P4', 'quantity':5, 'speedIn':60, 'speedOut':70}
h2so4 = {'pump':'P2', 'quantity':5, 'speedIn':60, 'speedOut':70}
kbro3 = {'pump':'P5', 'quantity':5, 'speedIn':110, 'speedOut':110}
malonic = {'pump':'P3', 'quantity':5, 'speedIn':60, 'speedOut':70}
water_clean = {'pump':'P4', 'quantity':50, 'speedIn':50, 'speedOut':70}
ferroin = {'pump':'P1', 'quantity':2, 'speedIn':50, 'speedOut':50}
# make sure these 4 pumps are filled, I will test ferroin individually
p.pump_multiple(water, malonic, kbro3, h2so4,ferroin)
# activate all max speed for 30 second to mix
b.activate_all()
time.sleep(30)
b.disable_all()
rv.record_threaded("test")
time.sleep(10)
p.pump_multiple(water_clean, waste)
p.pump_multiple(waste)