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

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