Just tried and the SPEAKER definition only defines the SPEAKER_PIN for C source to use.
If one wants to have global SPEAKER object there is extra work to do
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.
Just tried and the SPEAKER definition only defines the SPEAKER_PIN for C source to use.
If one wants to have global SPEAKER object there is extra work to do
Check
https://github.com/search?q=repo%3Aespruino%2FEspruino%20SPEAKER&type=code
how this is done for different boards.
Here is MICRORBIT2 way.