With the Afero GPIO system, you have up to four GPIOs that can be configured as inputs or outputs to help you get the job done. For example, a mousetrap might need an input to detect when the trap is sprung. Or a light might need an output to control the relay that turns the light on and off.
But there are lots of cases when you might need to have one GPIO value drive another. A good example of this is a light or electrical socket. Here you will need one output to control the relay that turns the power on and off. But there is a good chance you will also have a physical button on your product to let the user control it manually when their mobile device isn’t nearby. This is a perfect use case for the Afero “Bind” property.
Binding lets you bind one GPIO attribute value to another. So in the case of your switch input, you can easy bind the switch value to the relay value. When the user flips the switch, the input attribute value updates and then updates the attribute value of the relay.
If your switch is a momentary switch, you can use the Afero Profile Editor to set the “Is Toggle” property to convert that attribute to a toggle, with no additional circuitry. Now with a profile configured with two GPIO attributes, you can build an IoT light or electrical socket with simple components and not have to write a line of code!