File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 37
37
start_polarity = 0
38
38
prev_pressure = 0
39
39
PRINT_FLOOR = 5
40
+ peak_level = 0
40
41
if CONSOLE :
41
42
print ("CONSOLE?" )
42
43
if DEBUG and CONSOLE :
64
65
print ("PUFF" )
65
66
if start_polarity == - 1 :
66
67
print ("SIP" )
67
-
68
+ if start_polarity != 0 :
69
+ if level > peak_level :
70
+ peak_level = level
68
71
if (level == 0 ) and (start_polarity != 0 ):
69
72
duration = time .monotonic () - puff_start
70
73
if CONSOLE :
71
74
print ("END" , end = " " )
75
+
76
+ if peak_level == 1 :
77
+ print ("SOFT" , end = " " )
78
+ if peak_level == 2 :
79
+ print ("HARD" , end = " " )
80
+
72
81
if start_polarity == 1 :
73
- print ("PUFF" , "" )
82
+ print ("PUFF" )
74
83
if start_polarity == - 1 :
75
- print ("SIP" , "" )
84
+ print ("SIP" )
76
85
print ("Duration:" , duration )
77
86
start_polarity = 0
87
+ peak_level = 0
78
88
prev_level = level
79
89
prev_pressure = current_pressure
80
90
time .sleep (0.01 )
You can’t perform that action at this time.
0 commit comments