I want to drive simple buzzer with HAL library.I did this with mbed library and I played simple pirates of the caribbean melody.My mbed code like this :#include "mbed.h"
#define NOTE_C4 262 //Defining note frequency
#define NOTE_D4 294
#define ...
Thanks for help @Community member I find a solution . My solution :int setfreq(int freq) // 1 to 3000 Hz
{
int period = 60000 / freq; // compute period as function of 60KHz ticks
TIM2->ARR = period - 1;
TIM2->CCR2 = period / 2; // Channel 2 50/50
TI...