Yeah, the issue is that it needs to allocate 2*8*1024 = 16kB on the stack in order to perform the FFT in double arithmetic, and that's too much for Puck.js.
However you can still measure 500Hz - just record a shorter buffer of 512 samples and do the FFT on that (it works for higher frequencies too).
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.
Yeah, the issue is that it needs to allocate 2*8*1024 = 16kB on the stack in order to perform the FFT in double arithmetic, and that's too much for Puck.js.
However you can still measure 500Hz - just record a shorter buffer of 512 samples and do the FFT on that (it works for higher frequencies too).