Okay, so after trouble shooting that im now back to my original question, regarding using SPW2430(microphone). The code you had given me works to give me non zero values from the IDE.
var w = new Waveform(128);
w.on("finish", function(buf) {
for (var i in buf)
console.log(buf[i]);
});
w.startInput(B0,2000,{repeat:false});
How can I record for X amount of time then save it as a .raw file to an SD connected to the espruino? this is my current code but its not functioning correctly.
var spi = new SPI();
spi.setup({mosi:B15, miso:B14, sck:B10});
E.connectSDCard(spi, B1);
console.log(require("fs").readdirSync());
var w = new Waveform(128, {bits:16});
w.on("finish", function(buf) {
require("fs").writeFileSync("sound.raw",buf);
});
w.startInput(B0,2000,{repeat:false});
IDE error code:
in function called from system
Uncaught Error: Expecting first argument to be an array, not undefined
at line 1 col 16
buf.set(fileBuf);
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.
Okay, so after trouble shooting that im now back to my original question, regarding using SPW2430(microphone). The code you had given me works to give me non zero values from the IDE.
How can I record for X amount of time then save it as a .raw file to an SD connected to the espruino? this is my current code but its not functioning correctly.
IDE error code: