I've managed to successfully get an LED to flash on/off depending on the noise level with the set up below:
var five = require("johnny-five");
var analog = "A0"
var ledPin = 3;
five.Board().on("ready", function(){
var led = new five.Led(ledPin);
var analogSensor = new five.Sensor({pin:analog,
freq: 1000,
});
analogSensor.on("data", function() {
if(this.value > 700){
led.on();
} else {
console.log('light off');
}
});
});
I've managed to successfully get an LED to flash on/off depending on the noise level with the set up below: