40 Hz Square wave with 8kHz tone

Yes and adding some digitalWrite statements in there to turn on and off the LED would be easy enough.

If that’s what and all you need, leave the advanced techniques for when they are necessary.

Or not. Sooner or later…

a7