---------- >Use a cheap optically isolated scr or triac AC relay. Engineer a signal >to the micro at the AC line zero crossing. Maintain a number that >corresponds to the desired intensity level: say, the number of cycles >out of 128 that you expect to deliver power. Construct an algorithm that >turns the relay on or off at each zero crossing such the the following >two requirements are met: 1) the average voltage is zero and 2) the >number of on cycles are evenly distributed throughout the 128 cycle >period. > >Good luck - Tom Rogers VP - R&D Time Tech, Inc. A easy way to determine which cycles to turn on is to use 1 to 255 for the intensity level. One being the least, 255 being the most. Then at the start of each cycle, add the intesity level to a register. If there is a carry, use that cycle. Bill C.