Implemented mapping function to map from slider to PWM