Updated in line with recent protocol changes

Also added soft pwm scaling. Fixed buzzer frequency.