This Arduino library provides helpers for a custom Sonoff Dual firmware
- Control the LED
- Control the relays
- Detect short press and long press of the hardware button
- Download the latest version
- Load the
.zipwith Sketch → Include Library → Add .ZIP Library
See examples folder for examples.
Constructor. You don't have to instantiate an instance of the class, use the SonoffDual instance directly.
Setup the Serial connection, turn the LED off and set both relays off.
Return SonoffDualButton::NONE if nothing happened, or SonoffDualButton::SHORT or SonoffDualButton::LONG.
Set the state of the LED.
on: should the LED be on?
Set the state of the relays.
first: should the first relay be on?second: should the second relay be on?