Read bytes 1-2 instead of bytes 0-1 now that the firmare uses the status byte as expected.
This commit is contained in:
@@ -8,7 +8,7 @@ function readAdc() {
|
|||||||
console.log('Sending ', data);
|
console.log('Sending ', data);
|
||||||
device.write(data);
|
device.write(data);
|
||||||
const receivedBuffer = Buffer.from(device.readSync());
|
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)
|
setTimeout(readAdc, 500)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user