Merge pull request #16 from openelectron/add_heater_invert

Added config option to invert the polarity of the heater
pull/1/head
chrono 2016-04-07 15:06:14 +00:00
commit 8930e5700e
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -26,6 +26,8 @@ gpio_heat = 11 # Switches zero-cross solid-state-relay
gpio_cool = 10 # Regulates PWM for 12V DC Blower
gpio_air = 9 # Switches 0-phase det. solid-state-relay
heater_invert = 0 # switches the polarity of the heater control
### Inputs
gpio_door = 18

Wyświetl plik

@ -146,11 +146,17 @@ class Oven (threading.Thread):
if value:
self.heat = 1.0
if gpio_available:
GPIO.output(config.gpio_heat, GPIO.LOW)
if config.heater_invert:
GPIO.output(config.gpio_heat, GPIO.LOW)
else:
GPIO.output(config.gpio_heat, GPIO.HIGH)
else:
self.heat = 0.0
if gpio_available:
GPIO.output(config.gpio_heat, GPIO.HIGH)
if config.heater_invert:
GPIO.output(config.gpio_heat, GPIO.HIGH)
else:
GPIO.output(config.gpio_heat, GPIO.LOW)
def set_cool(self, value):
if value: