Browse Source

Change parameters.

main
gabriel becker 2 years ago
parent
commit
510fbd2a06
  1. 2
      src/alarm.py
  2. 12
      src/parameters.py
  3. 2
      src/pressure_sensor.py

2
src/alarm.py

@ -33,6 +33,8 @@ class Alarm:
Alarm.stop_alarm() Alarm.stop_alarm()
Alarm.led.off() Alarm.led.off()
Alarm.sleep_alarm() Alarm.sleep_alarm()
while True:
time.sleep(0.03)
@staticmethod @staticmethod
def stop_alarm(): def stop_alarm():

12
src/parameters.py

@ -1,20 +1,20 @@
"""Percentage that the previous pressure can be lower than current one without triggering the hole alarm.""" """Percentage that the previous pressure can be lower than current one without triggering the hole alarm."""
PRESSURE_TOLERANCE_PERCENTAGE = 1 PRESSURE_TOLERANCE_PERCENTAGE = 1
"""Pressure saturation threshold in mV to trigger the saturation alarm.""" """Pressure saturation threshold in V to trigger the saturation alarm."""
PRESSURE_SATURATION_THRESHOLD = 1.65 PRESSURE_SATURATION_THRESHOLD = 1.65
"""Lower limit of frequency in Hz to be considered inside interest rotation interval. (type: float)""" """Lower limit of frequency in Hz to be considered inside interest rotation interval. (type: float)"""
REFERENCE_ROTATION_DOWN_LIMIT = 250.0 REFERENCE_ROTATION_DOWN_LIMIT = 19.5
"""Higher limit of frequency in Hz to be considered inside interest rotation interval. (type: float)""" """Higher limit of frequency in Hz to be considered inside interest rotation interval. (type: float)"""
REFERENCE_ROTATION_UPPER_LIMIT = 270.0 REFERENCE_ROTATION_UPPER_LIMIT = 20.5
"""Weather or not the buzzer should be set to an annoying tone (in oder to keep the mental healthness of the developer).""" """Weather or not the buzzer should be set to an annoying tone (in oder to keep the mental healthness of the developer)."""
ANNOYING_BUZZER_ENABLED = False ANNOYING_BUZZER_ENABLED = True
"""How many samples of pressure should be used in smoother.""" """How many samples of pressure should be used in smoother."""
PRESSURE_SMOOTH_LENGTH = 25 PRESSURE_SMOOTH_LENGTH = 15
"""Period in seconds to wait when alarm reset button is presset until it starts again.""" """Period in seconds to wait when alarm reset button is presset until it starts again."""
ALARM_PAUSE_PERIOD = 5 ALARM_PAUSE_PERIOD = 60

2
src/pressure_sensor.py

@ -14,7 +14,7 @@ class PressureSensor:
@staticmethod @staticmethod
def read(): def read():
measure = PressureSensor._ADC.read(0) measure = PressureSensor._ADC.read(2)
return measure return measure
@staticmethod @staticmethod

Loading…
Cancel
Save