Fixed logic error in relais
This commit is contained in:
parent
bde19fd2b7
commit
d6ea24685b
2 changed files with 2 additions and 8 deletions
|
@ -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;
|
||||
|
|
|
@ -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); }
|
||||
|
||||
|
|
Loading…
Reference in a new issue