Thanks for pointing to missing 'var' statements, I just overlooked that! I'm not using JavaScript often, so tend to forget simple things.
Yes, wave thing is for playing WaveForms. It's not used here as I didn't get it output something really interesting yet. I know it's somewhat confusing in this example, but I was planning to make a reusable module from Buzzer, which could play both WaveForm and simple pitches, so the code is mentioning waves.
As for the PITCHES - this is a copy-paste from espruino examples. And too me it's more clear to have quotes there. There is no need to dig into JavaScript magic in this case :)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@allObjects,
Thanks for pointing to missing 'var' statements, I just overlooked that! I'm not using JavaScript often, so tend to forget simple things.
Yes, wave thing is for playing WaveForms. It's not used here as I didn't get it output something really interesting yet. I know it's somewhat confusing in this example, but I was planning to make a reusable module from Buzzer, which could play both WaveForm and simple pitches, so the code is mentioning waves.
As for the PITCHES - this is a copy-paste from espruino examples. And too me it's more clear to have quotes there. There is no need to dig into JavaScript magic in this case :)
Thanks for the feedback, it is really useful!