Update to Relay Library (relay-lib)

A while ago I made a general library (relay-lib) to act as a easy to use wrapper for a relay type of GPIO, and I see that people are using it on the Web IDE, so I thought I’d mention that I updated with a few things. It shouldn’t break previous usages, but it might, so let me know if it does.
The main point of what I did was allow for general “digitalWrite”-like functions, so that the same front end could be used with GPIO expanders. So now, you can construct an instance with the function, and then use it like you would anything else. See the example here for a general idea. I hope people find this useful!


  • Added pulse function
  • Changed pins in example for current particle board
  • Added ability to use any digitalWrite-like function (e.g. from MCP23008 library). Needs a wrapper function around the MCP23008 function.
  • Added MCP23008 Demo file
  • Switched isRelayOff/On to return bool.
  • Added init function
  • Updated readme
1 Like