- added range checks to io and pwm