Split PWM code to seperate file.