I have my arduino connected in serial with my laptop. The arduino has three
sensors.
The reading of the sensors is given by
Serial.print(sensor1);
Serial.print(",");
Serial.print(sensor2);
Serial.print(",");
Serial.print(sensor3);
Serial.print(",");
The arduino serial monitor is showing data perfectly
181 32 23
191 31 28
.................
In node.Js I wrote like this
function serialListener(debug)
{
var receivedData = "";
var receivedData1 = "";
serialPort = new SerialPort(portName, {
baudrate: 9600,
// defaults for Arduino serial communication
dataBits: 8,
parity: 'none',
stopBits: 1,
flowControl: false
});
serialPort.on("open", function () {
console.log('open serial communication');
// Listens to incoming data
serialPort.on('data',function(data,data1,data2) {
receivedData += data.toString();
receivedData += data1.toString();
receivedData += data2.toString();
console.log(receivedData, receivedData1,receivedData2);
});
});
}
The console is giving results like this
181,32,23,191,31,28...........
This means I will not be able to extract independent values.
Please help me how to listen to individual multiple values and get them
with HTML.
Thanks
Please note that I am getting perfect results with single sensor both in
node.js and in HTML
Thanks in advance
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.