I am having a ridiculously hard time trying to make a passive buzzer work correctly on my Seeeduino XIAO.
Here is how I believe it works, assuming the SOT23 smd is a PNP transistor? :

I plugged VCC to a +5V rail, GND to the ground rail, and I/O pin to my Seeeduino XIAO's pin 2 (aka "A2 / D2" :

When I write DigitalWrite(2, LOW), I can mesure about 0.4V on pin 2, while DigitalWrite(2, HIGH) reads about 3.3V (I assume the 5V rail feeding my Seeeduino XIAO's VCC gets converted to 3v3 through an internal regulator)
I understand I have to oscillate the signal to make this module buzz (remember it is a passive buzzer, or a transducer, whatever it is called), or simply use the tone() method, and I eventually managed to make this beep on and off every 1 second successfully during 10 seconds, but what bothers me is that I can NOT turn this module OFF after 10 seconds as a test in my sketch. It stops beeping after 10 sec as expected (ìf (millis() < 10000) { doBeep(); } , but it still draws massive current and gets hot after that delay. It's like the PNP transistor never turns off? I tried both digitalWrite HIGH and LOW but no success.
This is driving me crazy. What am I doing wrong?
