I use a dimmer module connected to an ESP07 which has Node MCU firmware.
I'm using the Z-C interrupt to skip sinusoidal pulses, however I only obtain flickering instead of dimming. The light is bulb is halogen based so it's dimmable.
Below is the code that I'm using. Do you have any idea what I should investigate?
--The Z-C pin gpio.mode(2, gpio.INPUT) --The PWM pin gpio.mode(5, gpio.OUTPUT) gpio.write(5, gpio.LOW) pwm.setup(5, 1000, 0) pwm.start(5) counter = 0; local function zc_callback(level, pulse) counter = counter + 1; counter = counter % 10; if (counter == 0) then pwm.setduty(5, 1023) else pwm.setduty(5, 0) end end gpio.trig(2, "low", zc_callback)