Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

marvinroger/arduino-sonoff-dual

Repository files navigation

Arduino Sonoff Dual

Build Status

This Arduino library provides helpers for a custom Sonoff Dual firmware

Features

  • Control the LED
  • Control the relays
  • Detect short press and long press of the hardware button

Installation

  1. Download the latest version
  2. Load the .zip with Sketch → Include Library → Add .ZIP Library

API

See examples folder for examples.

SonoffDualClass ()

Constructor. You don't have to instantiate an instance of the class, use the SonoffDual instance directly.

void .setup ()

Setup the Serial connection, turn the LED off and set both relays off.

SonoffDualButton .handleButton ()

Return SonoffDualButton::NONE if nothing happened, or SonoffDualButton::SHORT or SonoffDualButton::LONG.

void .setLed (bool on)

Set the state of the LED.

  • on: should the LED be on?

bool .setRelays (bool first, bool second)

Set the state of the relays.

  • first: should the first relay be on?
  • second: should the second relay be on?

About

Arduino library that provides helpers for a custom Sonoff Dual firmware

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

Languages

AltStyle によって変換されたページ (->オリジナル) /