File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737start_polarity = 0
3838prev_pressure = 0
3939PRINT_FLOOR = 5
40+ peak_level = 0
4041if CONSOLE :
4142 print ("CONSOLE?" )
4243if DEBUG and CONSOLE :
6465 print ("PUFF" )
6566 if start_polarity == - 1 :
6667 print ("SIP" )
67-
68+ if start_polarity != 0 :
69+ if level > peak_level :
70+ peak_level = level
6871 if (level == 0 ) and (start_polarity != 0 ):
6972 duration = time .monotonic () - puff_start
7073 if CONSOLE :
7174 print ("END" , end = " " )
75+
76+ if peak_level == 1 :
77+ print ("SOFT" , end = " " )
78+ if peak_level == 2 :
79+ print ("HARD" , end = " " )
80+
7281 if start_polarity == 1 :
73- print ("PUFF" , "" )
82+ print ("PUFF" )
7483 if start_polarity == - 1 :
75- print ("SIP" , "" )
84+ print ("SIP" )
7685 print ("Duration:" , duration )
7786 start_polarity = 0
87+ peak_level = 0
7888 prev_level = level
7989 prev_pressure = current_pressure
8090 time .sleep (0.01 )
You can’t perform that action at this time.
0 commit comments