implemnented basic PWM and fading
supporting 2 modes