L293 motor 1 and 2 stop working after using analog buzzer

I see. That was what I missed. The delays in the tone creation.

And you cannot do nearly anything else in loop(). In the end loop() creates the tone. All other activities in loop() - apart from very very short actions - will influence the tone. The ear is very sensitive if the pitch is not exactly right with melodies.

DFPlayerMini to the rescue!

1 Like

That would be a perfect solution to play melodies :slightly_smiling_face::slightly_smiling_face: