Closed pvint closed 3 years ago
I believe the problem is using delay(1000)
in fauxmo.onSetState
. You should try to have the code in onSetState
complete as quickly as possible.
I would suggest that instead of toggling the LED directly from onSetState
set a flag and handle it in your main loop. Also, avoid delay() there as well, as it can block other threads (See https://www.arduino.cc/en/Tutorial/BuiltInExamples/BlinkWithoutDelay for another method without using delay()
)
Original report by Lmm Cams (Bitbucket: [Lmm Cams](https://bitbucket.org/Lmm Cams), ).
Hi, im having trouble switching the state of gpio outputs on esp8266 nodemcu using arduino ide.
Any switching of state to HIGH or LOW simply fails or is ignored after fauxmo.onSetState([] …..
The sketch is supposed to trigger a relay that trigers the pushing of a remote control btn for 1second.
Here is the code -