Trying to use a buzzer, tone and noTone freeze my program

tone() uses pulse width modulation (PWM) on the pin to generate the frequency you (should) hear. `DigitalWrite(buzzer,HIGH)' simply sets the pin to +5V - no sound.