Skip to the content.

MycilaRelay

License: MIT Continuous Integration PlatformIO Registry

Arduino / ESP32 library to control Electromagnetic and Solid State Relays

Usage

Then use the relay:

Mycila::Relay relay1;

void setup() {
  relay1.begin(12);
  relay1.begin(12, Mycila::RelayType::NO, true);

  relay1.listen([](bool state) {
    Serial.printf("Relay 1 is %s\n", state ? "ON" : "OFF");
  });
}

void loop() {
  Mycila::relay1.toggle();
  Mycila::relay1.off();
  Mycila::relay1.on(500);
  // etc.

  delay(1000);
}

See example and API for more!