Replies: 4 comments 18 replies
-
What library do you use now for your PCF8574? You should include that in your HomeSpan sketch and access the pins exactly the same way you would if you were not using HomeSpan. For outputs, there is nothing specific to HomeSpan - simply use whatever command you were already using for the PCF8574 for sketches not involving HomeSpan. For inputs, you can configure |
Beta Was this translation helpful? Give feedback.
-
hello, can you help me? |
Beta Was this translation helpful? Give feedback.
-
The parameters (2,36) in the structure For example, if you wanted to pass a relay pin number and a button pin number to the structure, you can define it as such:
What you do with these variables depends on the specifics of your device. As you can see in Example 5, to turn on an LED directly attached to a pin, I use The same logic applied to using a GPIO extender with a SpanButton but there are a few extra steps that need to be taken. I recommend you first try implementing just the relay portion of the project with the GPIO extender - when that's all working let me know and we can see about adding the SpanButton code. |
Beta Was this translation helpful? Give feedback.
-
thank you very much, it can work now! |
Beta Was this translation helpful? Give feedback.
-
i have used your RealPushBotton demo code, it work well with relay and push bottons. this use ESP32 GPIO pin number directly. But now i have used PCF8574 IIC extend for get more GPIOs, how to define many GPIOs for relay and push buttons? i don't know which file to edit. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions