How to use a grove speaker without using delayMicroseconds?
It's just a small amplifier and speaker - what you put into the SIG pin gets amplified and sent out the speaker.

Instead of doing the audio generation manually like that I would suggest using the tone() function which will generate an audio tone at a desired frequency in the background.


https://www.arduino.cc/en/Reference/Tone