Slightly tweak USB command names.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user