2020-12-02 10:30 AM
Hello , I am able to generate the different frequency tones using the beep function. Can anyone guide how to play musical tones let's say happy birthday song on piezo buzzer?
2020-12-02 11:29 AM
The Standard Peripheral is currently using three fixed beep frequencies 1kHz, 2kHz and 4kHz, because that is often used for signalling using piezo transducers (buzzers).
For more frequencies, e.g. for C major or other scales, the library must be changed accordingly but STMicroelectronics do not provide a ready-made library for this.
Note: For a starting point please take a look at the SPL, especially stm8s_beep.c, stm8s_beep.h and the example BEEP_3SignalsGeneration that you may have already seen.
Good luck!
/Peter