Fixed logic error in relais

This commit is contained in:
Martin Brodbeck 2022-06-01 21:14:22 +02:00
parent bde19fd2b7
commit d6ea24685b
2 changed files with 2 additions and 8 deletions

View file

@ -36,7 +36,7 @@ void buttonPressedCallback(uint gpio, uint32_t events) {
} else {
lastPressed = get_absolute_time();
}
switch (gpio) {
case BUTTON_1_PIN:
temp_tgt -= 0.5;

View file

@ -6,13 +6,7 @@ Relais::Relais(uint gpio) : gpio{gpio} {
off();
}
void Relais::activate(bool active) {
if (active) {
gpio_pull_down(gpio);
} else {
gpio_pull_up(gpio);
}
}
void Relais::activate(bool active) { gpio_put(gpio, !active); }
void Relais::on() { activate(true); }