A microcontroller or state machine controls a light ballast utilizing a
timer structure. The microcontroller can program the timer structure to
generate pulses where the "average" frequency of a series of pulses can
be varied with higher resolution than the frequency of a single pulse.
This variation can occur without further microcontroller/state machine
intervention. The pulses are used to control the on and/or off time of
the light. The timer can be configured to modulate the outputs fast
enough to ensure that the light does not appear to flicker to the human
eye by limiting the number of pulses in a frame and by increasing the
number of times the frequency shift occurs compared to the obvious
implementation. The present invention relies on the fact that the human
eye is not capable of detecting small frequency changes in high frequency
signals and therefore uses pulses of two or more frequencies where the
frequencies are close together. The average frequency can then be varied
at much higher resolution than any single frequency.