Added pwmPeriod function