Afero Blog

In a Good Bind with Afero

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!

Scott Zimmerman

Born and raised in Silicon Valley, ZZ started his career at Intel in 1981 and has been building new technology ever since. He has worked with all parts of the stack from firmware to mobile applications at companies such as Intel, Apple, Sun, Danger, Microsoft, and Netflix. For fun he developed a battery charger for lithium ion batteries and was part of a team that set an electric motorcycle land speed record at the Bonneville Salt Flats.

post / 07.23.2017

Back Up Your Radio