Skip to content

Instantly share code, notes, and snippets.

@companje
Created June 25, 2018 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save companje/56caeb85bdec10ac64c47bd64343219b to your computer and use it in GitHub Desktop.
Save companje/56caeb85bdec10ac64c47bd64343219b to your computer and use it in GitHub Desktop.
UVC Control example / test
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