Rename USB scripts according to the recent USB command renames.
This commit is contained in:
16
packages/usb/get-adc-value.js
Executable file
16
packages/usb/get-adc-value.js
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env node
|
||||
const uhk = require('./uhk');
|
||||
|
||||
const device = uhk.getUhkDevice();
|
||||
|
||||
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(getAdcValue, 500)
|
||||
}
|
||||
|
||||
getAdcValue();
|
||||
Reference in New Issue
Block a user