Created
June 25, 2018 14:05
-
-
Save companje/56caeb85bdec10ac64c47bd64343219b to your computer and use it in GitHub Desktop.
UVC Control example / test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var UVCControl = require('uvc-control'); // <https://www.npmjs.com/package/uvc-control> | |
var camera = new UVCControl(0x46d, 0x82d); | |
function setValue(name,value) { | |
return new Promise(resolve => { | |
camera.set(name, value, function(error) { | |
if (error) { | |
console.log('ERROR: ',name, error); | |
} | |
resolve(); | |
}); | |
}) | |
} | |
async function main() { | |
await setValue("autoExposureMode", 8); | |
// await setValue("absoluteExposureTime", 250); // | |
await setValue("autoExposurePriority", 0); | |
await setValue("absoluteZoom", 100); | |
await setValue("absolutePanTilt", 0); | |
await setValue("autoFocus", 0); | |
await setValue("brightness", 128); | |
await setValue("contrast", 255); | |
await setValue("saturation", 255); | |
await setValue("sharpness", 255); | |
await setValue("backlightCompensation", 0); | |
await setValue("gain", 0); | |
await setValue("autoWhiteBalance", 0); | |
await setValue("absoluteFocus", 110); // | |
await setValue("whiteBalanceTemperature", 2784); // | |
UVCControl.controls.forEach(function(name) { | |
camera.get(name, function(error,value) { | |
console.log(name,'setting:', value); | |
}); | |
}) | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment