Hi all, I wanted to warn you that if you type an "@" by mistake, all the code in the code editor disappears! Also I tried to do the classic Tone with a buzzer and Arduino Nano but the code doesn't work because the compiler says it can't find setup and loop "variables" (functions I believe...). I'd like to fix the problem, so I am attaching some images and the code, I imported the pitches.h library into the Arduino folder.
Thank you.
so now everything should be working but the buzzer doesn't play the melody, am I missing something? It's a passive buzzer
Take a look at some of the built in examples with the Arduino
I have found where you have copied and pasted that code from and it seems that there are some hidden line codes in the code from the website… really simple fix… add a space underneath #include “pitches.h”. It must be text with different encoding. I shall look into it. Also when running audio based circuits, increase the simulation frequency to maximum 10,000hz to get the most accurate sound