Quote Originally Posted by Jerson View Post
1. Get triggered by the external interrupt pin on a mains zero crossing
2. When this happens, the TMR0 timer is loaded with the delay time to fire the triac. Think of this as a phase lag triggering like the triac dimmer you use in your lamps.
3. The 67 and 155 are limiting values for the delay time, so when you increase the value it should not increase beyond 155 and when you decrease it should not go below 67. If these conditions are not met, you will have weird behaviour on the triac dimmer
4. The load_value is the delay time I talk of here. The +/-8 is the step for the dimmer value
Thanks Jason, my name is Damien. Your explanation has showed me light at the end of a looong tunnel. Few questions have risen again:

1) Does this code wait for any command to start the light/fan or as soon as the circuit is connected it fires the triac?
2) What is "Nop, Nop..." & why it is repeated many times?

Thanks again (Getting there)