|
81 | 81 | ###################################### |
82 | 82 | current_pressure = lps.pressure |
83 | 83 | pressure_string = "Pressure: %0.3f" % current_pressure |
84 | | - if not CONSOLE: |
| 84 | + if CONSOLE: |
| 85 | + print(pressure_string) |
| 86 | + else: |
85 | 87 | print((current_pressure,)) |
| 88 | + |
86 | 89 | puff_polarity, puff_peak_level, puff_duration = detector.check_for_puff( |
87 | 90 | current_pressure |
88 | 91 | ) |
| 92 | + if CONSOLE: |
| 93 | + print("STATE:", detector.state) |
89 | 94 | if DEBUG and CONSOLE: |
90 | 95 | print( |
91 | 96 | "Pol: %s Peak: %s Dir: %s" |
|
95 | 100 | # if puff_duration: |
96 | 101 | if detector.state == DETECTED: |
97 | 102 | state = DETECTED |
98 | | - duration_string = "Duration: %0.2f" % puff_duration |
| 103 | + duration_string = ( |
| 104 | + "Duration: %0.2f" % puff_duration |
| 105 | + ) # puff duration can be none? after detect? |
99 | 106 | state_string = "DETECTED:" |
100 | 107 | print(state_string) |
101 | 108 | if puff_peak_level == 1: |
|
130 | 137 | state = WAITING |
131 | 138 | if (curr_time - state_display_start) > state_display_timeout: |
132 | 139 | state_string = "Waiting for Input" |
133 | | - detector_result_string = " " |
| 140 | + input_type_string = " " |
134 | 141 | duration_string = " " |
135 | 142 |
|
136 | | - if CONSOLE: |
137 | | - print("STATE:", state) |
138 | 143 | # Create the tet label |
139 | 144 | print((curr_time - state_display_start)) |
140 | 145 |
|
|
145 | 150 | detector_result = label.Label(font, text=input_type_string, color=color) |
146 | 151 | duration = label.Label(font, text=duration_string, color=color) |
147 | 152 | pressure_label = label.Label(font, text=pressure_string, color=color) |
| 153 | + if CONSOLE: |
| 154 | + print(banner.text) |
| 155 | + print(state.text) |
| 156 | + print(detector_result.text) |
| 157 | + print(duration.text) |
| 158 | + print(pressure_label.text) |
148 | 159 |
|
149 | 160 | banner.x = 0 |
150 | 161 | banner.y = 0 + Y_OFFSET |
|
0 commit comments