I got into a strange problem.
I got a buzzer and a LED driven by a 2N2222 connected to a MEGA 2560 as shown below.
The problem is that it will not buzz. I just hear a low clicking sound when it is being activated and deactivated. The LED lights up as it should.
When testing the circuit on a breadboard and connecting the resistor (that normally goes to A7) to Vcc, it work fine.
Why does it behave like this?

Here is a
link to the image in case you don't see it here.