I bought an AC dimmer module from aliexpress ( https://www.aliexpress.com/item/AC-Ligh ... 0.0.aPh4fV ) and I am able to get it working just fine with an arduino uno. However, with my nodemcu, it either doesn't work at all or it flickers (after I've played around with it). Here's the code I am using:
https://gist.github.com/bsmaat/6eb3fc56 ... 65c9c5993b
I've played with using different pins on the node mcu but no joy. As in the code above, the light doesn't turn on at all. If I increase the delay in delayMicroseconds(10) to delayMicroseconds(20) it flickers. When I print out millis() in the interrupt function, the time between consecutive millis() appears to be ~ 20, which seems right (I'm in the UK, and AC mains is 50 Hz => 20 ms wave length). Note, I've tried it without the Serial.println(..) statements as well, and just stuck them in there now for debugging purposes.
Any ideas or experiences yourselves?