sorry didnt got time to try it out.
Yes i had a look at the the AnalogLightSensor and the dhtDigitalSensor which i have both already running.
I have tried now two ways but both return always 0 for the first three bytes and 255 for the fourth byte.
SoundSensor is connected to A1 port.
First approach using the AnalogSensor and adding as a new defualt sensor class to the index.js (in analogSensor.js i can see the returned bytes are always 0 and 255):
var AnalogSensor = require('./base/analogSensor')
var commands = require('../commands')
function SoundAnalogSensor(pin) {
AnalogSensor.apply(this, Array.prototype.slice.call(arguments))
}
SoundAnalogSensor.prototype = new AnalogSensor()
SoundAnalogSensor.prototype.read = function() {
this.board.pinMode(this.board.INPUT)
var res = AnalogSensor.prototype.read.call(this)
var number = parseInt(res)
console.log('SOUND value: ' + number);
return number;
}
module.exports = SoundAnalogSensor
Second approach with a custom function as descriped in readme and basicTest.js files. (Also always returns 0 for first three bytes and 255 for third byte)
Hi s0h0,
could you please tell me more about the environment? Which version of Node.js are you running? Which is the firmware version of your GrovePi? Which model of Rpi do you have?
Thanks in advance
EDIT:
It’s not clear to me if you are facing issues with the AnalogLightSensor and the DHTDigitalSensor or if they are working fine for you. Please, let me know
Hey s0h0, thanks for the detailed informations.
The GrovePi version looks strange to me; I already saw that kind of response with old firmwares. Do you already know how to update your GrovePi’s firmware? Plus, do you have a GrovePi or a GrovePi+?
Thanks, M.
EDIT: Did you already try to read data from the Sound sensor with anything else attached to the GrovePi?
Yep, it’s a GrovePi. An update would be fine in any case (the link you have posted is OK for your GrovePi model) but probably it will not fix the issue with the Sound sensor which is, at this point, more likely related to the way to access to the bytes. Is this your sensor: http://www.seeedstudio.com/wiki/Grove_-_Sound_Sensor?
“Lastly, there is a screw potentiometer that enables manual adjustments to the output gain.!”
When i have moved the screw a little bit its now receiving signals… First i had read the spec of the soundSensor instead of the LoudnessSensor so i didnt got it…
Thank you very much for your support!