Hi,

Radek did the same thing inside its "Astroberry-DIY" drivers collection. You can find it here: github.com/rkaczorek/astroberry-diy and look in astroberry_relays .h and .cpp.
Hope this helps.

Regards

Read More...