Added a PWM example, simplified the global variable interface.