Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#70 [Python] overflow detection not working #72

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions py_driver/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,14 @@ def _underflow_check(self):
self.update_state(quick=True)

# check underflows
if self.state.Tube1_sonar_dist_mm < TUBE_MAX_LEVEL:
if self.state.Tube1_sonar_dist_mm > TUBE_MAX_LEVEL:
# if outflow is active while inflow is stopped, error out
if self.state.Tube1_outflow_duty > 0 and self.state.Tube1_inflow_duty == 0:
self.set_outflow(1, 0)
print(
f'{TAG}: WARN: Low water level detected in tube 1: {self.state.Tube1_sonar_dist_mm}. Stopped outflow')

elif self.state.Tube2_sonar_dist_mm < TUBE_MAX_LEVEL:
elif self.state.Tube2_sonar_dist_mm > TUBE_MAX_LEVEL:
# if outflow is active while inflow is stopped, error out
if self.state.Tube2_outflow_duty > 0 and self.state.Tube2_inflow_duty == 0:
self.set_outflow(2, 0)
Expand Down
Loading