I am using a yun.
attachInterrupt(0, zero_crosss_int, RISING);
Attach the Zero cross pin of the module to Arduino External Interrupt pin
Select the correct Interrupt # from the below table
Pin | Interrrupt # | Arduino Platform
---------------------------------------
2 | 0 | All
3 | 1 | All
18 | 5 | Arduino Mega Only
19 | 4 | Arduino Mega Only
20 | 3 | Arduino Mega Only
21 | 2 | Arduino Mega Only
I'm not familiar with the Yun, but I believe it is 32U4 based, and from this documentation, INT0 on the Yun is pin 3. What pin is used your zero cross interrupt input?
When i start the board with the program the clock goes to slow its counts the seconds ones up every 7 seconds.
If "LightOn" the light goes "on" and the clock changes every second, so thats oke.
If "LightOff" with a value 50 on dimming1 and 2 to clock goes slows down.
So i think there is a relation between the clock and the dimmer value.
Please post your current code.
Previously you said that a dimming value of 128 was OFF, and 0 was on which makes sense for the waveform chopping. How is 50 a value to produce OFF?
Can you please post a circuit diagram of your dimmer hardware.
There are some tests to do to understand the interaction between the clock and the interrupt/dimmer, but I'm not clear about what you have for code and circuitry. If you don't use the interrupt and the dimming delay, can you turn the light on and off by just applying 5v and 0v to the MOC. Does the clock slow down?