pwm code is now separate in pwm.h and pwm.c

pwm code is now separate in pwm.h and pwm.c