Read bytes 1-2 instead of bytes 0-1 now that the firmare uses the status byte as expected.

This commit is contained in:
László Monda
2017-11-04 02:06:01 +01:00
parent a5ff1cd97d
commit 6ab7bd9298

View File

@@ -8,7 +8,7 @@ function readAdc() {
console.log('Sending ', data);
device.write(data);
const receivedBuffer = Buffer.from(device.readSync());
console.log('Received', uhk.bufferToString(receivedBuffer), (receivedBuffer[1]*255 + receivedBuffer[0])/4096*5.5*1.045);
console.log('Received', uhk.bufferToString(receivedBuffer), (receivedBuffer[2]*255 + receivedBuffer[1])/4096*5.5*1.045);
setTimeout(readAdc, 500)
}