Hi
Is it possible to read data from GrovePI sensors on demand in NodeJS, currently I have to watch data using some thing like follows.
which is fine for testing individual sensors but my application requires location based gathering of sensor data i.e. I need to get sensor data based on gps readings and then log those values together with current location. I want to be able to just call something logically similar to the following code i.e. the var SensorReading gets the sensor reading when i call the function and i do not have to continuously watch for sensor readings when i do not need them,
are there any other event options i can use i.e. besides Sensor.on(‘change’,) to achieve this ?
var lightSensor = new LightAnalogSensor(3);
lightSensor.on('change', function (res) {
console.log('Light onChange value=' + res);
log(res)
})
lightSensor.watch(1000)
* ```
// i need something similar to this
var sensorReading = new LightAnalogSensor(3);