I think the click comes from the transition from 1 to -1 (and maybe at the beginning and end too), but basically that's all you need to do - just outputting -1 usually with bursts of 1 of varying lengths.
Doing something like b[i] = Math.sin(i); should at least give you something audible to test with though?
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.
I think the click comes from the transition from 1 to -1 (and maybe at the beginning and end too), but basically that's all you need to do - just outputting -1 usually with bursts of 1 of varying lengths.
Doing something like
b[i] = Math.sin(i);
should at least give you something audible to test with though?