(Resolvido) controlando dimmer com 2 lampadas

Good night. I know this post is old, but wish to contribute in some way. When you work with more than one dimmer at the same time, it is not possible to simply chain the time delays, is much more complicated. This happens because when you implement the first delay, the TIME HAS GONE!
In other words, suppose you have two dimmers, with shooting 4 pin and another on pin 5. Suppose that the delay of the first are 1000 microseconds, and the second 300 microseconds. If the delay of 1000 microseconds on pin 4 is applied, the corresponding lamp will light with a certain brightness. But don't forget it's been 1000 microseconds. If you apply a delay of 300 microseconds in the second, 5 pin, you're actually sending a pulse with actual 1000 delay = 1300 300 microseconds. To work, you need to do the following: determine which of the two has the SMALLER retardation dimmers. In our case, is the dimmer 5 pin:
delay = 5 PIN
Dimmer= 300us
delay=4 PIN
Dimmer=700us
The secret is always the second pulse, you have to deduct the value of the first delay. If however we have the following: pin and 5 Pin 4 with 10uS with 300uS, would:
delay = 4 PIN
Dimmer= 10us
delay=5 PIN
Dimmer=290us
So you need to re-write the code and come up with a function to determine which of the two is greater delays. The main difficulty is that the firing sequence is not fixed, now you shoot first the 4 pin, it is first the PIN 5. To increase the number of dimmers difficulty is bigger, but to do. I've managed to shoot 10 dimmers at the same time with the Arduino UNO.