added and  tested pwm resource. also fixed some bugs in the GPIO code