The GPIO port connects to the BEEP pin of terminal J2, allowing the buzzer to sound by inputting a high level on the GPIO port.
Frequency: Pitch, kHz
Duty Cycle: Sound intensity, 0~100%
The duty cycle is the ratio of the time the high level is on to the signal period: Duty Cycle = (Time at High Level / Signal Period) * 100%
**************************
Regular Sound: 1-4kHz, 50%
Maximum Volume: 2-3kHz, 70%-80%
Low Power: 500Hz-1kHz, 30%-40%
**************************
Passive Buzzer: External input pulse signal, the higher the frequency, the higher the pitch
Active Buzzer: Fixed pitch, volume adjusted by duty cycle
Other Notes:
In the ESP32, time.perf_counter() cannot be used for precise timing, but time.ticks_us() can be used for microsecond-level timing.
Experimental Effect: Simulated sound, playing music.
