Slightly tweak USB command names.

This commit is contained in:
László Monda
2017-11-08 23:13:03 +01:00
parent 6ba6ad543e
commit f9e1d022f2
6 changed files with 14 additions and 14 deletions

View File

@@ -3,14 +3,14 @@ const uhk = require('./uhk');
const device = uhk.getUhkDevice();
function readAdc() {
const data = uhk.getTransferData(new Buffer([uhk.usbCommands.readAdc]));
function getAdcValue() {
const data = uhk.getTransferData(new Buffer([uhk.usbCommands.getAdcValue]));
console.log('Sending ', data);
device.write(data);
const receivedBuffer = Buffer.from(device.readSync());
console.log('Received', uhk.bufferToString(receivedBuffer), (receivedBuffer[2]*255 + receivedBuffer[1])/4096*5.5*1.045);
setTimeout(readAdc, 500)
setTimeout(getAdcValue, 500)
}
readAdc();
getAdcValue();